4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
fcppt::parse::convert_if< Ch, Parser, Result > Class Template Reference

Detailed Description

template<typename Ch, typename Parser, typename Result>
class fcppt::parse::convert_if< Ch, Parser, Result >

Converts the success value of a parser into either another success value or an error.

If the parser p returns s, then convert(p,f) returns f(s), which can either be a success or an error value. Errors returned by p remain unchanged.

Template Parameters
ResultThe success type of this parser.
Inheritance diagram for fcppt::parse::convert_if< Ch, Parser, Result >:
fcppt::parse::tag

Public Types

using result_type = Result
 
using function_type
 

Public Member Functions

 convert_if (Parser &&, function_type &&)
 
template<typename Skipper >
fcppt::parse::result< Ch, result_typeparse (fcppt::reference< fcppt::parse::basic_stream< Ch > >, Skipper const &) const
 

Member Typedef Documentation

◆ function_type

template<typename Ch , typename Parser , typename Result >
using fcppt::parse::convert_if< Ch, Parser, Result >::function_type

◆ result_type

template<typename Ch , typename Parser , typename Result >
using fcppt::parse::convert_if< Ch, Parser, Result >::result_type = Result

Constructor & Destructor Documentation

◆ convert_if()

template<typename Ch , typename Parser , typename Result >
fcppt::parse::convert_if< Ch, Parser, Result >::convert_if ( Parser && ,
function_type &&  )

Member Function Documentation

◆ parse()

template<typename Ch , typename Parser , typename Result >
template<typename Skipper >
fcppt::parse::result< Ch, result_type > fcppt::parse::convert_if< Ch, Parser, Result >::parse ( fcppt::reference< fcppt::parse::basic_stream< Ch > > ,
Skipper const &  ) const
nodiscard