[#middle_of] [section middle_of] [h1 Synopsis] template struct middle_of; This is a [link parser_combinator parser combinator]. [table Arguments [[Name] [Type]] [[`P1`] [[link parser parser]]] [[`P2`] [[link parser parser]]] [[`P3`] [[link parser parser]]] ] [h1 Description] `middle_of` applies `P1`, `P2` and `P3` in sequence. It accepts an input when all of these three parsers accept it. The result of parsing is the result of `P2`. [h1 Header] #include [h1 Expression semantics] For any `p1`, `p2` and `p3` parsers middle_of is equivalent to nth_of<1, p1, p2, p3> [h1 Example] #include #include #include #include #include #include #include #include using namespace boost::metaparse; using int_token = token; using left_paren_token = token>; using right_paren_token = token>; using int_in_parens = middle_of; static_assert( get_result< int_in_parens::apply >::type::value == 13, "it should return the result of the middle parser" ); static_assert( is_error< int_in_parens::apply >::type::value, "it should reject the input when there are no parens" ); static_assert( is_error< int_in_parens::apply >::type::value, "it should reject the input when there is no closing paren" ); [endsect]