Sorry for asking so simple question, but I cannot find the answer easily. Google says nothing interesting about "C++ negation integral_constant" and similar queries.
Is there in C++11 any trait that make std::true_type
from std::false_type
and vice versa? In other words, I'd like some more readeble version of
std::is_same<my_static_bool, std::false_type>
I know of course I can write it myself, but I'd like to use the existing one if there is such.
!my_static_bool
? – Goddamnedmy_static_bool
is an integral constant, so he would have to writestd::integral_constant<bool, !my_static_bool::value>
(intentionally without::value
) to make it right. – Amazeconstexpr
operator!
might make it possible, haven't tried though. – Aerodontiamy_static_bool
can bestd::false_type
(or possiblystd::true_type
I imagine). Other than that, I don't quite understand your comment...std::integral_constant
has aconstexpr
conversion operatoroperator value_type()
that in the case ofstd::false_type
yieldsfalse
, which can be used with the not to yield atrue
constant expression – Goddamned!std::true_type
. – Amaze!my_static_bool::value
or!my_static_bool{}
– Goddamned