Boost logo

Boost Users :

Subject: Re: [Boost-users] [mpl][type_traits] Transforming to common type
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2014-02-22 10:55:13


AMDG

On 02/22/2014 05:25 AM, Bjorn Reese wrote:
> <snip>
> /usr/local/include/boost/type_traits/common_type.hpp:111:42: error:
> incompatible operand types ('mpl_::arg<1>' and 'int')
> typedef decltype(declval<bool>() ? declval<T>() : declval<U>()) type;
> ^ ~~~~~~~~~~~~ ~~~~~~~~~~~~
>
> It appears that the placeholder is not expanded to its actual type.
>

Don't use ::type in MPL Lambda expressions.
It forces immediate evaluation, which is
not what you want.

>
> <snip>
> boost::common_type<boost::mpl::_1, int>::type
> <snip>
>

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net