c++ - negation of std::integral_constant -
c++ - negation of std::integral_constant<bool> -
sorry asking simple question, cannot find reply easily. google says nil interesting "c++ negation integral_constant" , similar queries.
is there in c++11 trait create std::true_type
std::false_type
, vice versa? in other words, i'd more readeble version of
std::is_same<my_static_bool, std::false_type>
i know of course of study can write myself, i'd utilize existing 1 if there such.
there not, because it's one-liner , <type_traits>
should little possible.
template <typename t> using static_not = std::integral_constant<bool, !t::value>;
usage:
static_not<my_static_bool>
this right way because standard says "false_type
or derived such", can't depend on beingness equal std::false_type
. relax "having constexpr boolean ::value
property" because don't utilize tag dispatching.
c++ c++11 template-meta-programming typetraits boost-mpl
Comments
Post a Comment