any_state.hpp
Go to the documentation of this file.
Polymorphically holds any value implementing the state_traits.
Definition: any_state.hpp:48
static auto complete(T &&state) -> decltype(std::forward< T >(state))
Unwraps all the layers of state wrappers returning the deepmost.
Definition: state_traits.hpp:75
static auto is_reduced(T &&) -> bool
Returns whether the value is idempotent, and thus, the reduction can finish.
Definition: state_traits.hpp:60
#define ABL_DECLTYPE_RETURN(body_expr)
Utility for defining generic functions with a deduced return type, that are composed of a single expr...
Definition: utils.hpp:109
typename std::enable_if< X, T >::type enable_if_t
Similar to C++14 std::enable_if_t.
Definition: type_traits.hpp:84
auto state_unwrap(T &&s) -> decltype(state_traits_t< T >::unwrap(std::forward< T >(s)))
Convenience function for calling state_traits::unwrap
Definition: state_traits.hpp:136
auto state_data(T &&s, D &&d) -> decltype(state_traits_t< T >::data(std::forward< T >(s), std::forward< D >(d)))
Convenience function for calling state_traits::data
Definition: state_traits.hpp:127
Interface for a type specializing the State concept.
Definition: state_traits.hpp:53
MPL-compatible sequence that just holds a vector of types as a paremeter pack.
Definition: pack.hpp:57
static auto unwrap(T &&state) -> decltype(std::forward< T >(state))
Unwraps this layers of state wrappers, returning the nested state for the next reducing function...
Definition: state_traits.hpp:83
auto state_rewrap(T &&s, U &&x) -> decltype(state_traits_t< T >::rewrap(std::forward< T >(s), std::forward< U >(x)))
Convenience function for calling state_traits::unwrap_all
Definition: state_traits.hpp:152
auto state_complete(T &&s) -> decltype(state_traits_t< T >::complete(std::forward< T >(s)))
Convenience function for calling state_traits::complete
Definition: state_traits.hpp:110
static auto data(T &&, D &&d) -> decltype(std::forward< D >(d)())
Returns the associated from the current state.
Definition: state_traits.hpp:68
static auto unwrap_all(T &&state) -> decltype(std::forward< T >(state))
Unwraps all layers of state wrappers, returning the most nested state for the innermost reducing func...
Definition: state_traits.hpp:91
static auto rewrap(T &&, U &&x) -> decltype(std::forward< U >(x))
Copies all layers of state wrappers but replaces the innermost state with substate.
Definition: state_traits.hpp:99
auto state_is_reduced(T &&s) -> bool
Convenience function for calling state_traits::is_reduced
Definition: state_traits.hpp:118
auto state_unwrap_all(T &&s) -> decltype(state_traits_t< T >::unwrap_all(std::forward< T >(s)))
Convenience function for calling state_traits::unwrap_all
Definition: state_traits.hpp:144
This is a type that pretends to be convertible to anything.
Definition: utils.hpp:48