Boost logo

Boost :

Subject: Re: [boost] New dependency report
From: Peter Dimov (lists_at_[hidden])
Date: 2014-06-13 14:27:38

Eric Niebler wrote:
> On 06/13/2014 10:48 AM, Peter Dimov wrote:
> > Eric Niebler wrote:
> >> 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.

That's exactly what I said. Boost type traits are used in code that needs to
compile under C++03.

I agree with you that ::tag as a requirement for the integral constant
concept is a terrible idea. I do not agree with your C++11-based arguments,
neither do I agree that type traits should inherit from std::true_type. Type
traits should NOT inherit from anything.

The only requirement for a type trait (or a metaprogramming predicate, in
general) should be to have a ::value with a value of 0 or 1. Nothing more.
No ::tags. No required base classes. No mandatory dependencies of any kind.

If you want to dispatch, type traits with a ::value == 0 should be
_convertible_ to false_type, and type traits with a ::value == 1 should be
convertible to true_type, but they should not be required to derive from
them. This convertibility can be achieved from the true_type/false_type

The base classes in the standard are a mistake. The base classes in Boost
are a mistake.

Boost list run by bdawes at, gregod at, cpdaniel at, john at