Skip to content

Instantly share code, notes, and snippets.

@nihil84
Created February 10, 2019 17:01
Show Gist options
  • Save nihil84/b999e8990c4893e0adbb4f4341ac29dc to your computer and use it in GitHub Desktop.
Save nihil84/b999e8990c4893e0adbb4f4341ac29dc to your computer and use it in GitHub Desktop.
utility functions
template <class A>
struct reducpp::reduce {
template <class ...Reducers>
static inline composer<A, Reducers...> with(Reducers ...reducers) {
return composer<A, Reducers...>(reducers...);
}
};
template <class A>
struct reducpp::store_factory {
template <class ...Reducers>
static auto make_store(const Reducers& ...reducers) {
using CompositeState = typename composer<A, Reducers...>::CompositeState;
return store<CompositeState, A>(reduce<A>::with(reducers...));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment