123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #ifndef BOOST_URL_GRAMMAR_IMPL_OPTIONAL_RULE_HPP
- #define BOOST_URL_GRAMMAR_IMPL_OPTIONAL_RULE_HPP
- #include <boost/url/grammar/error.hpp>
- namespace boost {
- namespace urls {
- namespace grammar {
- template<class R>
- auto
- optional_rule_t<R>::
- parse(
- char const*& it,
- char const* end) const ->
- system::result<value_type>
- {
- if(it == end)
- return boost::none;
- auto const it0 = it;
- auto rv =
- this->get().parse(it, end);
- if(rv)
- return value_type(*rv);
- it = it0;
- return boost::none;
- }
- }
- }
- }
- #endif
|