You do not want to iterate over types, you want to create a package of parameters and deploy it in a variation template. You have an array, so the package you want is a package of integers 0,1,2 ... for serving indexes of arrays.
#include <redi/index_tuple.h> template<typename Ret, typename... Args> struct Function { Ret (*wrapped_function)(Args...); template<unsigned... I> Ret dispatch(void* args[], redi::index_tuple<I...>) { return wrapped_function(*static_cast<Args*>(args[I])...); } void CallbackBind(Ret * ret, void * args[]) { *ret = dispatch(args, to_index_tuple<Args...>()); } };
Something like this using index_tuple.h
The trick is that CallbackBind creates an index_tuple
integers representing arg positions and sends it to another function that outputs integers and extends the package to the list of expressions to use as arguments for the wrapped function.
source share