J
john.constantine
Hi
I have this code:
[begin main.cpp]
template<typename ClassType>
struct S
{
template<typename FunctionType> void member() {};
};
template<typename Type>
void g()
{
S<Type> s;
/*line 11*/ s.member<Type>();
}
void h()
{
S<int> s;
s.member<int>();
}
int main(int, char**)
{
g<int>();
h();
return 0;
}
[end main.cpp]
I compile it with g++ (GCC) 3.4.2 (mingw-special) and get this compiler
error:
.../main.cpp: In function `void g()':
.../main.cpp:11: error: expected primary-expression before '>' token
.../main.cpp:11: error: expected primary-expression before ')' token
I do not understand what is wrong with the expression in Line 11 and
where the difference between the calls in g and h is.
Can anyone explain this?
TIA
Gabriel
I have this code:
[begin main.cpp]
template<typename ClassType>
struct S
{
template<typename FunctionType> void member() {};
};
template<typename Type>
void g()
{
S<Type> s;
/*line 11*/ s.member<Type>();
}
void h()
{
S<int> s;
s.member<int>();
}
int main(int, char**)
{
g<int>();
h();
return 0;
}
[end main.cpp]
I compile it with g++ (GCC) 3.4.2 (mingw-special) and get this compiler
error:
.../main.cpp: In function `void g()':
.../main.cpp:11: error: expected primary-expression before '>' token
.../main.cpp:11: error: expected primary-expression before ')' token
I do not understand what is wrong with the expression in Line 11 and
where the difference between the calls in g and h is.
Can anyone explain this?
TIA
Gabriel