I have a function defined like this:
template<int... rests>
static std::enable_if_t<sizeof...(rests) == 0, void> getter(pokers_rep& rep, poker_index& out) {
}
template<int index, int... rests>
static void getter(pokers_rep& rep, poker_index& out) {
out |= rep.indices<index>();
getter<rests...>(rep, out);
}
and I would like to pass it into a function like this:
template<int N, int... rests>
struct index_filter :public index_filter<N - 1, N - 1, rests...> {
};
template<int... rests>
struct index_filter<1, rests...>
{
template< template<int... fntps> class Fn, class... Args>
inline static void execute(Fn<rests...>&& fn, Args&&... args) {
fn(args...);
}
};
I would like to pass the getter function to the parameter fn of the function index_filter::execute above.
I want to know if there is a way to achieve this. So I can pass any functions like getter to implement different functions by using the same struct index_fiter.
Using it like this:
poker_index out;
index_filter<4>::execute(getter, rep, out);