Compiler: TDM-GCC 5.1.0 (SJLJ Unwinding)
I'm having an issue passing variable number of type arguments to a static variadic template method call inside of a template function. I've tried every syntax variation, but it won't compile, so I can only assume I'm doing this wrong.
Here's the setup:
#include <iostream>
template <class T>
struct Foo
{
template <class...>
static void test()
{
std::cout << "Foo<T>::test<...>() called.";
}
};
template <class T, class... Args>
void bar()
{
Foo<T>::test<Args...>(); //error happens here
}
int main()
{
bar<int, int>();
}
This gives the compiler error: expected primary-expression before '...' token
.
I thought pack expansions looked like Args...
, but that doesn't seems to work here.
Any help is appreciated.