[#boost-urls-grammar-not_empty_rule]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::not&lowbar;empty&lowbar;rule
:relfileprefix: ../../../
:mrdocs:

Match another rule, if the result is not empty

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/not_empty_rule.hpp#Lundefined[boost&sol;url&sol;grammar&sol;not&lowbar;empty&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;
not&lowbar;empty&lowbar;rule(R const& r);
----

== Description

This adapts another rule such that when an empty string is successfully parsed, the result is an error&period;

== Value Type

[,cpp]
----
using value_type = typename Rule::value_type;
----
== Example

Rules are used with the function xref:boost/urls/grammar/parse-09.adoc[`parse`]&period;

[,cpp]
----
system::result< decode_view > rv = parse( "Program%20Files",
    not_empty_rule( pct_encoded_rule( unreserved_chars ) ) );
----
== Return Value

The adapted rule

== Parameters

[cols="1,4"]
|===
|Name|Description

| *r*
| The rule to match
|===

== See Also

xref:boost/urls/grammar/parse-09.adoc[`parse`], 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]#
