Boost logo

Geometry :

Subject: Re: [geometry] Why reverse_dispatch returns bool rather than mpl::bool_<T> ?
From: Menelaos Karavelas (menelaos.karavelas_at_[hidden])
Date: 2014-05-20 12:35:01


Hi Samuel.

On 20/05/2014 05:43 μμ, Samuel Debionne wrote:
>> reverse_dispatch<> is derived from integral_constant<bool, ...> so AFAIU
>> it can be passed directly to the mpl metafunction. Or am I wrong about
>> this?
> Thanks Adam, I was just about to answer my question with an other (more
> accurate) question :
>
> Why is the template parameter Reverse of say dispatch::distance of
> non-type bool rather than mpl::bool_ ?
>
> template
> <
> ...
> *bool* Reverse = reverse_dispatch<Geometry1, Geometry2>::type::value

Although I was not part of the design team of this, I would argue that
it is like that because it works.
If you want to make it a type, simply wrap it with
boost::integral_constant. This will give you boost::true_type or
boost::false_type.

Ref:
http://www.boost.org/doc/libs/1_55_0/libs/type_traits/doc/html/boost_typetraits/reference/integral_constant.html

Or you can use the MPL analog:
http://www.boost.org/doc/libs/1_55_0/libs/mpl/doc/refmanual/integral-constant.html

- m.

> Samuel
>
> _______________________________________________
> Geometry mailing list
> Geometry_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/geometry


Geometry list run by mateusz at loskot.net