Boost logo

Boost :

Subject: Re: [boost] Road to low-quality-code is paved with good intentions of dropping dependencies
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2015-01-07 12:21:01

El 07/01/2015 a las 17:48, Nevin Liber wrote:
> On 7 January 2015 at 09:22, Beman Dawes <bdawes_at_[hidden]> wrote:
>> For all the type traits that are now supported by the standard library
>> in use, it might be nice if #include
>> <boost/type_traits/std/some_trait.hpp> brought in the standard library
>> version. So eventually the many boost libraries that use only type
>> traits that have been standardized would have no dependencies on the
>> actual boost implementations.
> In order to do that, we need to somehow unify the following unrelated types:
> std::integral_constant<bool, b>
> boost::integral_constant<bool, b>
> boost::mpl::integral_c<bool, b>

We could try to improve interoperability with a type that accepts
anything that seems a true/false-type. Something like:

namespace boost {
namespace core_traits {

template<bool Value>
struct bool_type
    template<class BoolType>
     , enable_if_internal_bool_value_is_equal_to
          <Value>::type * = 0

} //namespace core_traits {
} //namespace boost {

So every custom integral_constant would be convertible to bool_type, and
a very basic trait that does not derive from integral_constant:

template<class T>
struct is_mytrait
    static const bool value = /**/;

could be used with tag dispatching or enable_if + is_convertible.



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