Boost logo

Boost :

From: joel falcou (joel.falcou_at_[hidden])
Date: 2008-07-29 08:13:41


> type_traits uses integral_constant<bool,val> for true/false
results which
> in turn inherits from mpl::bool_<val> so the
two should be completely
> compatible with each other. Note that
integral_constant is part of the
> TR1 and the next std, where as
MPL is not, so type_traits won't be changing in
> this
respect.

OK, so it's maybe me. I used a lot of type_traits and
MPL meta-function as generator for static boolean that serves as templae
overload selector like :

template<class T, class EnableIf =
is_integral<T>::type> struct foo;
template<class T>
struct foo<T,false_type> {};

and I found that having to
manage both true_/false_ and true_type/false_type in various overload a
bit hard, especially if a tempalte has two set of EnableIf,one using
traits one using MPL. Is going with usign the ::value a better idea, (aka
making EnableIf a bool parameter ?)

Thanks anyway for your
welcomed insight


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk