...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Data Types / Numeric / bool_ |
template< bool C > struct bool_ { // unspecified // ... }; typedef bool_true_; typedef bool_ false_;
A boolean Integral Constant wrapper.
#include <boost/mpl/bool.hpp>
Parameter | Requirement | Description |
---|---|---|
C | A boolean integral constant | A value to wrap. |
The semantics of an expression are defined only where they differ from, or are not defined in Integral Constant.
For arbitrary integral constant c:
Expression | Semantics |
---|---|
bool_ |
An Integral Constant x such that x::value == c and x::value_type is identical to bool. |
BOOST_MPL_ASSERT(( is_same< bool_::value_type, bool > )); BOOST_MPL_ASSERT(( is_same< bool_ , true_ > )); } BOOST_MPL_ASSERT(( is_same< bool_ ::type, bool_ > )); BOOST_MPL_ASSERT_RELATION( bool_ ::value, ==, true ); assert( bool_ () == true );