I have a function which takes one parameter with a default value. Now I also want it to take a variable number of parameters and forward them to some other function. Function pa
Another approach would be to pass variadic arguments through a tuple.
template
void func (std::tuple t, SomeSpecialType num = fromNum(5))
{
// don't forget to move t when you use it for the last time
}
Pros : interface is much simpler, overloading and adding default valued arguments is quite easy.
Cons : caller has to manually wrap arguments in a std::make_tuple
or std::forward_as_tuple
call. Also, you'll probably have to resort to std::index_sequence
tricks to implement the function.