![]() |
Home | Libraries | People | FAQ | More |
boost::parser::opt_parser
// In header: <boost/parser/parser.hpp> template<typename Parser> struct opt_parser { // public member functions template<typename Iter, typename Sentinel, typename Context, typename SkipParser> auto (Iter &, Sentinel, Context const &, SkipParser const &, , bool &) ; template<typename Iter, typename Sentinel, typename Context, typename SkipParser, typename Attribute> void (Iter &, Sentinel, Context const &, SkipParser const &, , bool &, Attribute &) ; // public data members Parser parser_; };
Repeats the application of another parser of type Parser
, [0, 1]
times. The parse always succeeds. The attribute produced is a std::optional<T>
, where T
is the type of attribute produced by Parser
.
opt_parser
public member functionstemplate<typename Iter, typename Sentinel, typename Context, typename SkipParser> auto (Iter & first, Sentinel last, Context const & context, SkipParser const & skip, flags, bool & success) ;
template<typename Iter, typename Sentinel, typename Context, typename SkipParser, typename Attribute> void (Iter & first, Sentinel last, Context const & context, SkipParser const & skip, flags, bool & success, Attribute & retval) ;