Is there any built-in, or library-provided way to map a set of variadic template arguments in D?
For example:
void foo(Args...)(Args args)
{
bar(fun(args));
}
I want that to expand to:
void foo(Args...)(Args args)
{
bar(fun(args[0]), fun(args[1]), fun(args[2]), /* ... */);
}
C++11 variadic templates support this. How do you do the same in D?
This is the best I’ve come up with:
You use it like this:
Where bar is the function to call and t is the transformation.