12 This is a [link lazy_metafunction lazy template metafunction] that supports
13 [link currying currying].
17 [[`D`] [[link boxed_value boxed] character value]]
22 Converts a boxed character containing a value in the range `['0'..'9']` to an
27 It returns a [link boxed_value boxed] integer value.
31 #include <boost/metaparse/util/digit_to_int.hpp>
33 [h1 Expression semantics]
35 For any `C` boxed character value in the range `['0'..'9']` the following
36 expressions are equivalent
38 digit_to_int<>::apply<C>::type
40 digit_to_int_c<C::type::value>::type
44 #include <boost/metaparse/util/digit_to_int.hpp>
46 #include <type_traits>
48 using namespace boost::metaparse;
50 struct nullary_metafunction_returning_4
52 using type = std::integral_constant<char, '4'>;
56 util::digit_to_int<std::integral_constant<char, '0'>>::type::value == 0,
57 "it should convert a character to the corresponding integer value"
61 util::digit_to_int<>::type
62 ::apply<std::integral_constant<char, '7'>>::type::value == 7,
63 "it should support currying"
67 util::digit_to_int<nullary_metafunction_returning_4>::type::value == 4,
68 "it should support lazy evaluation"