9 This is a [link parser parser].
13 [[`C`] [[link boxed_value boxed] character value]]
18 Parser accepting only the `C` character. The result of parsing is the accepted
23 #include <boost/metaparse/lit.hpp>
25 [h1 Expression semantics]
27 For any `c` boxed character the following are equivalent:
33 boost::mpl::lambda<boost::mpl::equal_to<boost::mpl::_1, c>>::type,
34 error::literal_expected<c::type::value>
39 #include <boost/metaparse/lit.hpp>
40 #include <boost/metaparse/start.hpp>
41 #include <boost/metaparse/string.hpp>
42 #include <boost/metaparse/is_error.hpp>
43 #include <boost/metaparse/get_result.hpp>
45 #include <type_traits>
47 using namespace boost::metaparse;
51 lit<std::integral_constant<char, 'x'>>
52 ::apply<BOOST_METAPARSE_STRING("a"), start>
54 "a different character should be an error"
59 lit<std::integral_constant<char, 'x'>>
60 ::apply<BOOST_METAPARSE_STRING(""), start>
62 "empty input should be an error"
67 lit<std::integral_constant<char, 'x'>>
68 ::apply<BOOST_METAPARSE_STRING("x"), start>
69 >::type::value == 'x',
70 "result of parsing should be the accepted character"