File indexing completed on 2025-01-18 09:53:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_URL_GRAMMAR_IMPL_OPTIONAL_RULE_HPP
0011 #define BOOST_URL_GRAMMAR_IMPL_OPTIONAL_RULE_HPP
0012
0013 #include <boost/url/grammar/error.hpp>
0014
0015 namespace boost {
0016 namespace urls {
0017 namespace grammar {
0018
0019 template<class R>
0020 auto
0021 optional_rule_t<R>::
0022 parse(
0023 char const*& it,
0024 char const* end) const ->
0025 system::result<value_type>
0026 {
0027 if(it == end)
0028 return boost::none;
0029 auto const it0 = it;
0030 auto rv =
0031 this->get().parse(it, end);
0032 if(rv)
0033 return value_type(*rv);
0034 it = it0;
0035 return boost::none;
0036 }
0037
0038 }
0039 }
0040 }
0041
0042 #endif