4.4.1
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions
fcppt::options::sum< Label, Left, Right > Class Template Reference

Detailed Description

template<typename Label, typename Left, typename Right>
class fcppt::options::sum< Label, Left, Right >

A sum of two parsers.

This parser first tries its left parser and if that succeeds returns its result. Otherwise, it tries the right parser and returns its result.

Classes

struct  left
 
struct  right
 

Public Types

using left_result = fcppt::options::result_of< Left >
 
using right_result = fcppt::options::result_of< Right >
 
using variant = fcppt::variant::object< fcppt::options::left< left_result >, fcppt::options::right< right_result > >
 
using result_type = fcppt::record::object< fcppt::record::element< Label, variant > >
 

Public Member Functions

 sum (Left &&, Right &&)
 
fcppt::options::parse_result< result_typeparse (fcppt::options::state &&, fcppt::options::parse_context const &) const
 
fcppt::options::flag_name_set flag_names () const
 
fcppt::options::option_name_set option_names () const
 
fcppt::options::usage usage () const
 

Member Typedef Documentation

◆ left_result

template<typename Label , typename Left , typename Right >
using fcppt::options::sum< Label, Left, Right >::left_result = fcppt::options::result_of<Left>

◆ result_type

template<typename Label , typename Left , typename Right >
using fcppt::options::sum< Label, Left, Right >::result_type = fcppt::record::object<fcppt::record::element<Label, variant> >

◆ right_result

template<typename Label , typename Left , typename Right >
using fcppt::options::sum< Label, Left, Right >::right_result = fcppt::options::result_of<Right>

◆ variant

template<typename Label , typename Left , typename Right >
using fcppt::options::sum< Label, Left, Right >::variant = fcppt::variant:: object<fcppt::options::left<left_result>, fcppt::options::right<right_result> >

Constructor & Destructor Documentation

◆ sum()

template<typename Label , typename Left , typename Right >
fcppt::options::sum< Label, Left, Right >::sum ( Left &&  ,
Right &&   
)

Member Function Documentation

◆ flag_names()

template<typename Label , typename Left , typename Right >
fcppt::options::flag_name_set fcppt::options::sum< Label, Left, Right >::flag_names ( ) const

◆ option_names()

template<typename Label , typename Left , typename Right >
fcppt::options::option_name_set fcppt::options::sum< Label, Left, Right >::option_names ( ) const

◆ parse()

template<typename Label , typename Left , typename Right >
fcppt::options::parse_result< result_type > fcppt::options::sum< Label, Left, Right >::parse ( fcppt::options::state &&  ,
fcppt::options::parse_context const &   
) const

◆ usage()

template<typename Label , typename Left , typename Right >
fcppt::options::usage fcppt::options::sum< Label, Left, Right >::usage ( ) const