6 template <class Result>
9 This is a [link parser parser].
13 [[`Result`] [[link metaprogramming_value template metaprogramming value]]]
18 It accepts empty input only. The result of parsing is the `Result`
23 #include <boost/metaparse/empty.hpp>
25 [h1 Expression semantics]
27 For any `c` class the following are equivalent:
31 except<one_char, c, error::end_of_input_expected>
35 #include <boost/metaparse/empty.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 #include <type_traits>
43 using namespace boost::metaparse;
45 using want_empty = empty<BOOST_METAPARSE_STRING("result")>;
48 !is_error<want_empty::apply<BOOST_METAPARSE_STRING(""), start>>::type::value,
49 "empty accepts the empty input"
53 is_error<want_empty::apply<BOOST_METAPARSE_STRING("x"), start>>::type::value,
54 "empty should reject non-empty input"
59 get_result<want_empty::apply<BOOST_METAPARSE_STRING(""), start>>::type,
60 BOOST_METAPARSE_STRING("result")
62 "the result of parsing should be the given value"