[#token] [section token] [h1 Synopsis] template struct token; This is a [link parser_combinator parser combinator]. [table Arguments [[Name] [Type]] [[`P`] [[link parser parser]]] ] [h1 Description] `token` parses the input using `P` when it succeeds, `token` consumes all whitespaces afterwards. The result of parsing is the result of `P`. [h1 Header] #include [h1 Expression semantics] For any `p` parser the following are equivalent: token

first_of [h1 Example] #include #include #include #include #include #include #include #include using namespace boost::metaparse; using int_token = token; static_assert( get_result< int_token::apply >::type::value, "the result of int_token is the number" ); static_assert( std::is_same< BOOST_METAPARSE_STRING(""), get_remaining>::type >::type::value, "token consumes whitespaces after the number" ); static_assert( get_result< int_token::apply >::type::value, "whitespaces after the number are optional" ); static_assert( is_error>::type::value, "when there is no number, token fails" ); [endsect]