boost::urls::grammar::squelch :: Boost Libraries Documentation

# boost::urls::grammar::squelch

Squelch the value of a rule

## Synopsis

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

    template<Rule R>
    constexpr
    /* implementation-defined */
    squelch(R const& r) noexcept;

## Description

This function returns a new rule which matches the specified rule, and converts its value type to `void`. This is useful for matching delimiters in a grammar, where the value for the delimiter is not needed.

## Value Type

    using value_type = void;

## Example 1

With `squelch`:

    system::result< std::tuple< decode_view, core::string_view > > rv = parse(
        "www.example.com:443",
        tuple_rule(
            pct_encoded_rule(unreserved_chars + '-' + '.'),
            squelch( delim_rule( ':' ) ),
            token_rule( digit_chars ) ) );

## Example 2

Without `squelch`:

    system::result< std::tuple< decode_view, core::string_view, core::string_view > > rv = parse(
        "www.example.com:443",
        tuple_rule(
            pct_encoded_rule(unreserved_chars + '-' + '.'),
            delim_rule( ':' ),
            token_rule( digit_chars ) ) );

## Return Value

The squelched rule

## Parameters

Name | Description
r | The rule to squelch

## See Also

`delim_rule`, `digit_chars`, `parse`, `tuple_rule`, `token_rule`, `decode_view`, `pct_encoded_rule`, `unreserved_chars`.

Created with MrDocs