Front Page / Data Types / Numeric / char_ |
An Integral Constant wrapper for char.
#include <boost/mpl/char.hpp>
Parameter | Requirement | Description |
---|---|---|
N | A character 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 character constant c:
Expression | Semantics |
---|---|
char_<c> | An Integral Constant x such that x::value == c and x::value_type is identical to char. |
typedef char_<'c'> c; BOOST_MPL_ASSERT(( is_same< c::value_type, char > )); BOOST_MPL_ASSERT(( is_same< c::type, c > )); BOOST_MPL_ASSERT(( is_same< next< c >::type, char_<'d'> > )); BOOST_MPL_ASSERT(( is_same< prior< c >::type, char_<'b'> > )); BOOST_MPL_ASSERT_RELATION( (c::value), ==, 'c' ); assert( c() == 'c' );