123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef BOOST_URL_GRAMMAR_OPTIONAL_RULE_HPP
- #define BOOST_URL_GRAMMAR_OPTIONAL_RULE_HPP
- #include <boost/url/detail/config.hpp>
- #include <boost/url/optional.hpp>
- #include <boost/url/error_types.hpp>
- #include <boost/core/empty_value.hpp>
- #include <boost/assert.hpp>
- namespace boost {
- namespace urls {
- namespace grammar {
- #ifdef BOOST_URL_DOCS
- template<class Rule>
- constexpr
- __implementation_defined__
- optional_rule( Rule r ) noexcept;
- #else
- template<class Rule>
- struct optional_rule_t
- : private empty_value<Rule>
- {
- using value_type = boost::optional<
- typename Rule::value_type>;
- system::result<value_type>
- parse(
- char const*& it,
- char const* end) const;
- template<class R_>
- friend
- constexpr
- auto
- optional_rule(
- R_ const& r) ->
- optional_rule_t<R_>;
- private:
- constexpr
- optional_rule_t(
- Rule const& r) noexcept
- : empty_value<Rule>(
- empty_init,
- r)
- {
- }
- };
- template<class Rule>
- auto
- constexpr
- optional_rule(
- Rule const& r) ->
- optional_rule_t<Rule>
- {
- return { r };
- }
- #endif
- }
- }
- }
- #include <boost/url/grammar/impl/optional_rule.hpp>
- #endif
|