This is a simple question, yet the Internet offers no answer or examples to this one:
what is the correct means of passing a parameter pack to a std::tuple
?
I have tried the following, only to find I received the error:
'missing template arguments before token':
#include <tuple>
#include <iostream>
template <typename... Args>
std::tuple <Args...> footup;
template <typename... Args>
void bar(std::tuple <Args...>& footup, Args... args)
{
footup = std::make_tuple(args...);
}
int main()
{
bar(footup, 1, 2, 3, 4, 5, 6, 7);
std::cout << std::get <0>(footup) << " "
<< std::get <1>(footup) << " "
<< std::get <2>(footup) << "\n\n";
return 0;
}
How do I prevent the error message and have the parameter pack work?