[#boost-urls-grammar-squelch]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::squelch
:relfileprefix: ../../../
:mrdocs:


Squelch the value of a rule

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/tuple_rule.hpp#L218[boost&sol;url&sol;grammar&sol;tuple&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;xref:boost/urls/grammar/Rule.adoc[Rule] R&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::xref:boost/urls/grammar/implementation_defined/squelch_rule_t.adoc[squelch&lowbar;rule&lowbar;t]&lt;R&gt;
squelch(R const& r) noexcept;
----

== Description


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


=== Value Type

[,cpp]
----
using value_type = void;
----

=== Example 1

With `squelch`&colon;

[,cpp]
----
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`&colon;

[,cpp]
----
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 ) ) );
----


== Parameters


|===
| Name | Description

| *r*
| The rule to squelch


|===

== See Also


xref:boost/urls/grammar/delim_rule-01.adoc[delim&lowbar;rule],        xref:boost/urls/grammar/digit_chars.adoc[digit&lowbar;chars],        xref:boost/urls/grammar/parse-02.adoc[parse],        xref:boost/urls/grammar/tuple_rule.adoc[tuple&lowbar;rule],        xref:boost/urls/grammar/token_rule.adoc[token&lowbar;rule],        xref:boost/urls/decode_view.adoc[decode&lowbar;view],        xref:boost/urls/pct_encoded_rule.adoc[pct&lowbar;encoded&lowbar;rule],        xref:boost/urls/unreserved_chars.adoc[unreserved&lowbar;chars]&period;






[.small]#Created with https://www.mrdocs.com[MrDocs]#
