I don't understand why the following code doesn't compile:
template< typename TypeArg >
class Data
{
public:
struct Selector1
{
};
template< typename Selector >
void foo()
{
}
};
template< typename TypeArg >
class Test
{
public:
void test();
};
template< typename TypeArg >
void Test< TypeArg >::test()
{
Data< TypeArg > data;
data.foo< typename Data< TypeArg >::Selector1 >();
}
I have tested it with GCC 4.6 and GCC 4.9. Both give me the same error:
test.cpp: In member function »void Test::test()«: test.cpp:28:51: Error: expected »(« before »>« token test.cpp:28:53: Error: expected primary-expression before »)« token
Can somebody tell me what needs to be done for the code to compile?