El 07/01/2015 a las 17:48, Nevin Liber wrote:
On 7 January 2015 at 09:22, Beman Dawes
wrote: For all the type traits that are now supported by the standard library in use, it might be nice if #include
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
boost::integral_constant boost::mpl::integral_c
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> bool_type (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. Best, Ion