File indexing completed on 2025-01-18 09:53:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_URL_GRAMMAR_VARIANT_RULE_HPP
0011 #define BOOST_URL_GRAMMAR_VARIANT_RULE_HPP
0012
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/error_types.hpp>
0015 #include <boost/url/variant.hpp>
0016 #include <boost/url/grammar/detail/tuple.hpp>
0017
0018 namespace boost {
0019 namespace urls {
0020 namespace grammar {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070 #ifdef BOOST_URL_DOCS
0071 template<class... Rules>
0072 constexpr
0073 __implementation_defined__
0074 variant_rule( Rules... rn ) noexcept;
0075 #else
0076 template<
0077 class R0, class... Rn>
0078 class variant_rule_t
0079 {
0080 public:
0081 using value_type = variant<
0082 typename R0::value_type,
0083 typename Rn::value_type...>;
0084
0085 auto
0086 parse(
0087 char const*& it,
0088 char const* end) const ->
0089 system::result<value_type>;
0090
0091 template<
0092 class R0_,
0093 class... Rn_>
0094 friend
0095 constexpr
0096 auto
0097 variant_rule(
0098 R0_ const& r0,
0099 Rn_ const&... rn) noexcept ->
0100 variant_rule_t<R0_, Rn_...>;
0101
0102 private:
0103 constexpr
0104 variant_rule_t(
0105 R0 const& r0,
0106 Rn const&... rn) noexcept
0107 : rn_(r0, rn...)
0108 {
0109 }
0110
0111 detail::tuple<R0, Rn...> rn_;
0112 };
0113
0114 template<
0115 class R0,
0116 class... Rn>
0117 constexpr
0118 auto
0119 variant_rule(
0120 R0 const& r0,
0121 Rn const&... rn) noexcept ->
0122 variant_rule_t<R0, Rn...>;
0123 #endif
0124
0125 }
0126 }
0127 }
0128
0129 #include <boost/url/grammar/impl/variant_rule.hpp>
0130
0131 #endif