|
5.0.0
Freundlich's C++ toolkit
|
Makes a parser optional.
Let p be a parser and let o = optional{p}. First, o saves the current position pos and then tries p. If p succeeds, then its result is returned. Otherwise, o backtracks to pos. If the returned error is fatal, then o also returns it. Otherwise, o returns the empty optional.
Public Types | |
| using | result_type = fcppt::optional::object<fcppt::parse::result_of<Parser>> |
Public Member Functions | |
| optional (Parser &&) | |
| template<typename Ch, typename Skipper> | |
| fcppt::parse::result< Ch, result_type > | parse (fcppt::reference< fcppt::parse::basic_stream< Ch > >, Skipper const &) const |
| using fcppt::parse::optional< Parser >::result_type = fcppt::optional::object<fcppt::parse::result_of<Parser>> |
|
explicit |
|
nodiscard |