[#sequence] [section sequence] [h1 Synopsis] template struct sequence; This is a [link parser_combinator parser combinator]. [table Arguments [[Name] [Type]] [[`Ps`] [[link parser parser]s]] ] [h1 Description] `sequence` applies the `Ps...` parsers in sequence on the input. It accepts an input when all of these parsers accept it. The result of parsing is a sequence of the results of the parsers. On compilers, which are not C++11-compliant, the maximum number of parsers `sequence` accepts can be specified with the `BOOST_METAPARSE_LIMIT_SEQUENCE_SIZE` macro. Its default value is `5`. [h1 Header] #include [h1 Expression semantics] For any `n > 0`, `p0`, ..., `pn` parsers the result of `sequence` is a compile-time sequence of the results of the parsers, applied after each other in order on the input string when none of them returns an error. The remaining string is the remaining string the last parser returns. When one of the parsers returns an error, the combinator returns that error. [h1 Example] #include #include #include #include #include #include #include #include #include using namespace boost::metaparse; using int_token = token; using plus_token = token>; using a_plus_b = sequence; static_assert( boost::mpl::at_c< get_result>::type, 0 >::type::value == 1, "the first element of the sequence should be the first number" ); static_assert( boost::mpl::at_c< get_result>::type, 1 >::type::value == '+', "the second element of the sequence should be the plus" ); static_assert( boost::mpl::at_c< get_result>::type, 2 >::type::value == 2, "the third element of the sequence should be the second number" ); static_assert( is_error>::type::value, "when not all of the parsers accept the input, sequence should fail" ); [endsect]