10 This is a [link lazy_metafunction lazy template metafunction] that supports
11 [link currying currying].
15 [[`C`] [[link accept accept] or [link reject reject] value]]
20 Determines if `C` is a parsing error or not. Returns a [link boxed_value boxed]
25 #include <boost/metaparse/is_error.hpp>
27 [h1 Expression semantics]
29 For any `e` parsing error `is_error<c>::type` is a wrapped compile-time `true`
30 value, for any other `c` class `is_error<c>::type` is a wrapped compile-time
35 #include <boost/metaparse/is_error.hpp>
36 #include <boost/metaparse/accept.hpp>
37 #include <boost/metaparse/reject.hpp>
38 #include <boost/metaparse/string.hpp>
39 #include <boost/metaparse/start.hpp>
40 #include <boost/metaparse/define_error.hpp>
42 #include <type_traits>
44 using namespace boost::metaparse;
46 BOOST_METAPARSE_DEFINE_ERROR(sample_error, "Sample error message");
50 typedef reject<sample_error, start> type;
56 std::integral_constant<int, 13>,
57 BOOST_METAPARSE_STRING("foo"),
61 "an accept should not be an error"
65 is_error<reject<sample_error, start>>::type::value,
66 "an reject should be an error"
70 is_error<>::type::apply<reject<sample_error, start>>::type::value,
71 "it should support currying"
75 is_error<returns_reject>::type::value,
76 "it should support lazy evaluation"