[#repeated_reject_incomplete] [section repeated_reject_incomplete] [h1 Synopsis] template struct repeated_reject_incomplete; This is a [link parser_combinator parser combinator]. [table Arguments [[Name] [Type]] [[`P`] [[link parser parser]]] ] [h1 Description] The same as [link repeated `repeated`], but once `P` rejects the input, `repeated_reject_incomplete` checks if `P` consumes any characters before rejecting the input. If so, `repeated_reject_incomplete` rejects the input with the same error message this last application of `P` returned. Otherwise `repeated_reject_incomplete` accepts the input and gives the same result as [link repeated `repeated`]. Here is a diagram showing how `repeated_reject_incomplete` works by example: using int_token = token; using plus_token = token>; using plus_int = last_of; using sum_op = mpl::lambda>::type; [$images/metaparse/repeated_reject_incomplete_diag1.png [width 70%]] [h1 Header] #include [h1 Expression semantics] For any `p` parser, `s` compile-time string and `pos` source position repeated_reject_incomplete

::apply is equivalent to first_of, fail_at_first_char_expected

>::apply [h1 Example] #include #include #include #include #include #include #include #include #include #include #include using namespace boost::metaparse; using int_token = token; using plus_token = token>; using plus_int = last_of; using ints = repeated_reject_incomplete; static_assert( boost::mpl::equal< boost::mpl::vector_c, get_result< ints::apply >::type >::type::value, "ints should parse the numbers" ); static_assert( is_error< ints::apply >::type::value, "when the last number is missing, it should be an error" ); [endsect]