Created
February 10, 2019 17:01
-
-
Save nihil84/b999e8990c4893e0adbb4f4341ac29dc to your computer and use it in GitHub Desktop.
utility functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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