Generic

Functions

template<typename Strat1 , typename Strat2 >
choice_strategy< Strat1, Strat2 > aurelia::operator+ (const Strat1 &s1, const Strat2 &s2)
 Runs s1, then s2 if s1 failed. It fails if none of s1 and s2 succeeded.
debug_strategy aurelia::debug (const std::string &s)
 When evaluated, it prints the input value in the standard error output. It requires the type of input to be printable.
template<typename S >
not_strategy< S > aurelia::not_ (const S &s)
 When evaluated, the strategy fails when s succeeds, and succeeds when s fails.
template<typename S >
repeat_strategy< S > aurelia::repeat (const S &s)
 The strategy calls s until it fails then returns the last suceeding value. The output type of S must be convertible to the input type.
template<typename Strat1 , typename Strat2 >
seq_strategy< Strat1, Strat2 > aurelia::operator< (const Strat1 &s1, const Strat2 &s2)
 The strategy calls s1, then s2 if s1 succeeded. It succeeds if s2 does.
template<typename Kernel >
side_effect_strategy< Kernel > aurelia::side_effect (const Kernel &k)
 Converts a non-const strategy expresion to a const one.
template<typename Strat >
auto aurelia::try_ (const Strat &s)-> decltype(s+id)
 The strategy runs s and suceeds even if s fails.
template<typename S >
where_strategy< S > aurelia::where (const S &s)
 The strategy runs s. On success, it restores the previous value.

Variables

fail_strategy aurelia::fail
 A strategy that always fails for any given input type.
id_strategy aurelia::id
 A strategy that always succeeds for any given input type.

Function Documentation

template<typename Kernel >
side_effect_strategy<Kernel> aurelia::side_effect ( const Kernel &  k)

Converts a non-const strategy expresion to a const one.

Template Parameters:
Kernelside_effect_strategy_concept<Kernel, T> for some given T
Parameters:
kA strategy of type Kernel
Returns:
An object which type holds strategy_concept<_, T> for the same types T for which side_effect_strategy_concept<Kernel, T> holds