This is not possible, as far as I know. You should use std::tupleto store the parameters:
template<typename... Args>
struct A
{
std::tuple<std::decay_t<Args>...> args_;
A(Args&&... args) : args_(std::make_tuple(std::forward<Args>(args)...))
{}
};
With C ++ 17, you can use std::applyfor cal functions args_as parameters instead of unpacking them
std::apply(func, args_);
source
share