9 This is a [link parser parser].
13 [[`C`] [`char` value]]
18 Parser accepting only the `C` character. The result of parsing is the accepted
23 #include <boost/metaparse/lit_c.hpp>
25 [h1 Expression semantics]
27 For any `c` character the following are equivalent:
31 lit<boost::mpl::char_<c>>
35 #include <boost/metaparse/lit_c.hpp>
36 #include <boost/metaparse/start.hpp>
37 #include <boost/metaparse/string.hpp>
38 #include <boost/metaparse/is_error.hpp>
39 #include <boost/metaparse/get_result.hpp>
41 using namespace boost::metaparse;
44 is_error<lit_c<'x'>::apply<BOOST_METAPARSE_STRING("a"), start>>::type::value,
45 "a different character should be an error"
49 is_error<lit_c<'x'>::apply<BOOST_METAPARSE_STRING(""), start>>::type::value,
50 "empty input should be an error"
55 lit_c<'x'>::apply<BOOST_METAPARSE_STRING("x"), start>
56 >::type::value == 'x',
57 "result of parsing should be the accepted character"