c++ - Looking for a metafunction from bool to bool_type -
basically, looking library solution this:
#include <boost/type_traits.hpp> template<bool> struct bool_to_bool_type; template<> struct bool_to_bool_type<false> { typedef boost::false_type type; }; template<> struct bool_to_bool_type<true> { typedef boost::true_type type; }; is there such metafunction?
boost already provides boost::mpl::bool_<>:
boost.typetraits uses integral_constant:
boost_static_assert(( is_same< integral_constant<bool, false>, is_class<int>::type >::value ));
Comments
Post a Comment