...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
template<class T> struct negation : public integral_constant<bool, !bool(T::value)> { };
Inherits: Inherits from integral_constant<bool,
!bool(T::value)>
.
Header: #include
<boost/type_traits/negation.hpp>
Compiler Compatibility: All current compilers are supported by this trait.
Examples:
negation<true_type>
inherits fromfalse_type
.
negation<false_type>
inherits fromtrue_type
.
negation<integral_constant<int, 4> >::type
is the typefalse_type
.
negation<integral_constant<int, 0> >::value
is an integral constant expression that evaluates to true.
negation<T>::value_type
is the typebool
.