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

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -