File indexing completed on 2025-01-18 09:53:27
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
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 #ifdef BOOST_URL_DOCS
0047 template<class Rule>
0048 constexpr
0049 __implementation_defined__
0050 not_empty_rule( Rule r );
0051 #else
0052 template<class R>
0053 struct not_empty_rule_t
0054 {
0055 using value_type =
0056 typename R::value_type;
0057
0058 auto
0059 parse(
0060 char const*& it,
0061 char const* end) const ->
0062 system::result<value_type>;
0063
0064 template<class R_>
0065 friend
0066 constexpr
0067 auto
0068 not_empty_rule(
0069 R_ const& r) ->
0070 not_empty_rule_t<R_>;
0071
0072 private:
0073 constexpr
0074 not_empty_rule_t(
0075 R const& r) noexcept
0076 : r_(r)
0077 {
0078 }
0079
0080 R r_;
0081 };
0082
0083 template<class Rule>
0084 auto
0085 constexpr
0086 not_empty_rule(
0087 Rule const& r) ->
0088 not_empty_rule_t<Rule>
0089 {
0090
0091
0092
0093
0094 static_assert(
0095 is_rule<Rule>::value,
0096 "Rule requirements not met");
0097
0098 return { r };
0099 }
0100 #endif
0101
0102 }
0103 }
0104 }
0105
0106 #include <boost/url/grammar/impl/not_empty_rule.hpp>
0107
0108 #endif