Boost logo

Boost :

Subject: Re: [boost] New dependency report
From: John Maddock (boost.regex_at_[hidden])
Date: 2014-06-13 14:16:12


>>> I think in the C++11 world, boost type_traits should *all* inherit
>>> from std::true_type. That's easily accomplished by aliasing mpl::true_
>>> to std::true_type. It fixes everything.
>>
>> I can't help but note that you're focusing on the wrong aspect of the
>> problem. In the C++11 world, we have type traits in std and none of this
>> matters. Use of Boost type traits is motivated by the need to support
>> C++03.
>
> I'm focusing on a larger set of problems. And use use of mpl isn't
> restricted to C++03 code. Nor is boost.type_traits for that matter; it's
> used in code that must be portable, like boost libraries. Anyone using a
> boost library with a C++11 compiler is getting old-style type traits
> whether they like it or not, and these implementation details can
> sometimes bubble out in annoying ways. If the user of a lib has to
> specialize a type trait, they'll be surprised when they use
> std::true_type and find their specialization doesn't meet the lib's
> requirements, for instance.

Plus there are type traits in Boost that aren't in the std.

Can we not use inheritance:

boost::integral_constant<bool b> from mpl::bool_<b> from
std::integral_constant<bool, b> ?

The first part of this is already in place BTW. mpl::bool_ would just
have to add those members not present in std::integral_constant by way
of backwards compatibility.

John.


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