Instead of performing recursive calls, I want an arbitrary number of functions to trigger based on some condition in a loop.
How do I transform method0, method1 to be called for a variadic number of typename ... methods?
Edit: As you cannot return a variadic number of types, I modified the example a litte.
template <typename method0, typename method1, typename ... Args>
void loop(Args ... args)
{
for (int i = 0; i < iter_max; i++)
{
if (method0::condition(args))
{
method0::call_modify(args);
}
if (method1::condition(args))
{
method1::call_modify(args);
}
//...
}
}
template<typename ... Args>
struct method0
{
static bool condition(Args& ... args)
{
//Trigger condition
}
static void call_modify(Args& ... args)
{
//Perform action on args
}
};