Boost C++ Libraries 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.


negation<true_type> inherits from false_type.

negation<false_type> inherits from true_type.

negation<integral_constant<int, 4> >::type is the type false_type.

negation<integral_constant<int, 0> >::value is an integral constant expression that evaluates to true.

negation<T>::value_type is the type bool.