![]() |
Home | Libraries | People | FAQ | More |
Match a rule, or the empty string.
Defined in header <boost/url/grammar/optional_rule.hpp>
template< class Rule> constexpr implementation-defined optional_rule( Rule r);
Optional BNF elements are denoted with square brackets. If the specified rule returns any error it is treated as if the rule did not match.
using value_type = [link url.ref.boost__urls__optional `optional< typename Rule::value_type >`];
Rules are used with the function grammar::parse
.
system::result< optional< core::string_view > > rv = [link url.ref.boost__urls__grammar__parse `parse`]( "" , [link url.ref.boost__urls__grammar__optional_rule `optional_rule`]( [link url.ref.boost__urls__grammar__token_rule `token_rule`]( [link url.ref.boost__urls__grammar__alpha_chars `alpha_chars`] ) ) );
[link url.ref.boost__urls__optional `optional`] = [ rule ]
Name |
Description |
---|---|
|
The rule to match |
alpha_chars
,
parse
,
optional
,
token_rule
.
Convenience header <boost/url/grammar.hpp>