I have a template variadic function:
template <typename ... argsType>
static bool Call(std::string const& Key, argsType&& ... Args)
{
/* ... */
}
This is called for example like this:
Call("add2", 1, 2);
Call("add3", 1, 2, 3);
Call("true", true);
Then I also have different containers with a variable number of elements:
std::vector<int> v1 = {1, 2};
std::vector<int> v2 = {1, 2, 3};
std::vector<bool> v3 = {true};
Now is there any way to call the variadic function with the values of these containers, or do I have to change that function so that it accepts containers as parameter? If possible I would like to do something like this:
Call("add2", /* use v1 here */);
Call("add3", /* use v2 here */);
Call("true", /* use v3 here */);