Possible Duplicate:
Where and why do I have to put “template” and “typename” on dependent names?
Here's my problem:
template<typename TypeName> class Bubu
{
...
vector<TypeName>::iterator Foo()
{
...
}
...
}
This gives:
error C2146: syntax error: missing ';' before identifier 'Foo'
If I change the typename to an actual type, like int or SomeClass, it works:
vector<int>::iterator Foo(){}
What I want to have is something like:
Bubu<SomeClassType> bubuInstance;
vector<SomeClassType>::iterator it = bubuInstance.Foo();
What's wrong? How do I fix it?