Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This is an older version of Boost and was released in 2023. The current version is 1.90.0.
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 = variant< typename Rules::value_type... >;
Rules are used with the function parse.
// request-target = origin-form // / absolute-form // / authority-form // / asterisk-form result< variant< url_view, url_view, authority_view, string_view > > rv = grammar::parse( "/index.html?width=full", variant_rule( origin_form_rule, absolute_uri_rule, authority_rule, delim_rule('*') ) );
variant = rule1 / rule2 / rule3...
absolute_uri_rule,
authority_rule,
delim_rule,
parse,
origin_form_rule,
url_view,
variant.
Convenience header <boost/url/grammar.hpp>