boost::urls::grammar::tuple_rule

Match a series of rules in order

Synopsis

Declared in header <boost/url/grammar/tuple_rule.hpp>

template<
    class R0,
    class... Rn>
constexpr
implementation-defined
tuple_rule(
    R0 const& r0,
    Rn const&... rn) noexcept;

Description

This matches a series of rules in the order specified. Upon success the input is adjusted to point to the first unconsumed character. There is no implicit specification of linear white space between each rule.

Value Type

using value_type = __see_below__;

The sequence rule usually returns a std::tuple containing the the value_type of each corresponding rule in the sequence, except that void values are removed. However, if there is exactly one non-void value type T, then the sequence rule returns system::result<T> instead of system::result<tuple<…​>>.

Example

Rules are used with the function parse .

system::result< std::tuple< unsigned char, unsigned char, unsigned char, unsigned char > > rv =
    parse( "192.168.0.1",
        tuple_rule(
            dec_octet_rule,
            squelch( delim_rule('.') ),
            dec_octet_rule,
            squelch( delim_rule('.') ),
            dec_octet_rule,
            squelch( delim_rule('.') ),
            dec_octet_rule ) );

BNF

sequence     = rule1 rule2 rule3...

Parameters

Name Description

rn

A list of one or more rules to match