state_wrapper.hpp
Go to the documentation of this file.
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
auto state_wrapper_data(TagT tag, T &&s, D &&) -> decltype(state_wrapper_data(tag, std::forward< T >(s)))
Utility function for easy overloading of state_traits::data for state wrappers with a specific tag...
Definition: state_wrapper.hpp:173
#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
auto state_wrapper_unwrap_all(TagT, T &&s) -> decltype(state_unwrap_all(state_unwrap(std::forward< T >(s))))
Utility function for easy overloading of state_traits::unwrap_all for state wrappers with a specific ...
Definition: state_wrapper.hpp:147
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
STL namespace.
bool state_wrapper_is_reduced(TagT tag, T &&s)
Utility function for easy overloading of state_traits::is_reduced for state wrappers with a specific ...
Definition: state_wrapper.hpp:210
auto state_wrapper_rewrap(TagT, T &&s, U &&x) -> decltype(wrap_state< TagT >( state_rewrap(state_unwrap(std::forward< T >(s)), x), state_wrapper_data(std::forward< T >(s))))
Utility function for easy overloading of state_traits::rewrap for state wrappers with a specific tag...
Definition: state_wrapper.hpp:159
Interface for a type specializing the State concept.
Definition: state_traits.hpp:53
auto state_wrapper_unwrap(TagT, T &&s) -> decltype(std::get< 0 >(std::forward< T >(s)))
Utility function for easy overloading of state_traits::unwrap for state wrappers with a specific tag...
Definition: state_wrapper.hpp:135
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
Metafunction returning whether StateT is a, or reference to, a state_wrapper instantiation.
Definition: state_wrapper.hpp:90
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
auto wrap_state(StateT &&next, DataT &&data=DataT{}) -> state_wrapper< TagT, estd::decay_t< StateT >, estd::decay_t< DataT > >
Given a tag TagT and a state next and associated data, returns a state_wrapper instance.
Definition: state_wrapper.hpp:104
A decorator for the accumulator of a reduction.
Definition: state_wrapper.hpp:69
auto state_wrapper_complete(TagT, T &&s) -> decltype(state_complete(state_unwrap(std::forward< T >(s))))
Utility function for easy overloading of state_traits::complete for state wrappers with a specific ta...
Definition: state_wrapper.hpp:123