File indexing completed on 2025-09-18 09:07:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_URL_GRAMMAR_NOT_EMPTY_RULE_HPP
0011 #define BOOST_URL_GRAMMAR_NOT_EMPTY_RULE_HPP
0012
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/error_types.hpp>
0015 #include <boost/url/grammar/type_traits.hpp>
0016
0017 namespace boost {
0018 namespace urls {
0019 namespace grammar {
0020
0021 namespace implementation_defined {
0022 template<class R>
0023 struct not_empty_rule_t
0024 {
0025 using value_type =
0026 typename R::value_type;
0027
0028 auto
0029 parse(
0030 char const*& it,
0031 char const* end) const ->
0032 system::result<value_type>;
0033
0034 constexpr
0035 not_empty_rule_t(
0036 R const& r) noexcept
0037 : r_(r)
0038 {
0039 }
0040
0041 private:
0042 R r_;
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
0071
0072 template<BOOST_URL_CONSTRAINT(Rule) R>
0073 auto
0074 constexpr
0075 not_empty_rule(
0076 R const& r) ->
0077 implementation_defined::not_empty_rule_t<R>
0078 {
0079
0080
0081
0082
0083 static_assert(
0084 is_rule<R>::value,
0085 "Rule requirements not met");
0086
0087 return { r };
0088 }
0089
0090 }
0091 }
0092 }
0093
0094 #include <boost/url/grammar/impl/not_empty_rule.hpp>
0095
0096 #endif