Home | Libraries | People | FAQ | More |
namespace util { template <int C> struct int_to_digit_c; }
This is a template class similar to a template
metafunction but taking an int
value as argument.
Converts an integer value in the range [0-9]
to a character representing that decimal
value.
#include <boost/metaparse/util/int_to_digit_c.hpp>
The following pairs of expressions are equivalent
int_to_digit_c<0>::type boost::mpl::char_<'0'> int_to_digit<9>::type boost::mpl::char_<'9'>
#include <boost/metaparse/util/int_to_digit_c.hpp> using namespace boost::metaparse; static_assert( util::int_to_digit_c<0>::type::value == '0', "it should convert an integer value to the corresponding character" ); static_assert( util::int_to_digit_c<3>::type::value == '3', "it should convert an integer to the corresponding character" ); static_assert( util::int_to_digit_c<9>::type::value == '9', "it should convert an integer value to the corresponding character" );