![]() |
Home | Libraries | People | FAQ | More |
Match one of a set of rules.
Defined in header <boost/url/grammar/variant_rule.hpp>
template< class... Rules> constexpr implementation-defined variant_rule( Rules... rn);
Each specified rule is tried in sequence. When the first match occurs, the result is stored and returned in the variant. If no match occurs, an error is returned.
using value_type = [link url.ref.boost__urls__variant `variant`]< typename Rules::value_type... >;
Rules are used with the function parse
.
// request-target = origin-form // / absolute-form // / authority-form // / asterisk-form system::result< variant< url_view, url_view, authority_view, core::string_view > > rv = [link url.ref.boost__urls__grammar__parse `grammar::parse`]( "/index.html?width=full" , [link url.ref.boost__urls__grammar__variant_rule `variant_rule`]( [link url.ref.boost__urls__origin_form_rule `origin_form_rule`], [link url.ref.boost__urls__absolute_uri_rule `absolute_uri_rule`], [link url.ref.boost__urls__authority_rule `authority_rule`], [link url.ref.boost__urls__grammar__delim_rule `delim_rule`]( '*' ) ) );
[link url.ref.boost__urls__variant `variant`] = rule1 / rule2 / rule3...
absolute_uri_rule
,
authority_rule
,
delim_rule
,
parse
,
origin_form_rule
,
url_view
,
variant
.
Convenience header <boost/url/grammar.hpp>