9 This is a [link parser parser].
13 [[`Msg`] [[link parsing_error_message parsing error message]]]
18 Parser rejecting every input.
22 #include <boost/metaparse/fail.hpp>
24 [h1 Expression semantics]
26 For any `msg` parsing error message, `s` compile-time string and `pos` source
29 fail<msg>::apply<s, pos>::type
31 returns an error with `msg` as the error message.
35 #include <boost/metaparse/fail.hpp>
36 #include <boost/metaparse/string.hpp>
37 #include <boost/metaparse/start.hpp>
38 #include <boost/metaparse/is_error.hpp>
39 #include <boost/metaparse/get_message.hpp>
40 #include <boost/metaparse/define_error.hpp>
42 using namespace boost::metaparse;
44 BOOST_METAPARSE_DEFINE_ERROR(sample_error, "This is an example parsing error");
46 using fail_p = fail<sample_error>;
49 is_error<fail_p::apply<BOOST_METAPARSE_STRING("foo"), start>>::type::value,
50 "it should reject every input"
55 get_message<fail_p::apply<BOOST_METAPARSE_STRING("foo"), start>>::type,
58 "the error message should be the type specified"