Possible Duplicate:
Where and why do I have to put the “template” and “typename” keywords?
declaring a C++ set iterator
I’m trying to compile C++ some code, which works fine in Windows, in a Linux System.
I have got many errors like the following one:
code:
..
39 set<Node<T>*>::iterator child;
...
g++ gives me the error:
Node.h:39: error: expected ‘;’ before ‘child’
This is just an example. Can you give me some hint on how to solve it?
You have to write
Indeed, the compiler does not know that
iteratoris the name of atypedefined in the templated classset. You have to tell it explicitely.Visual Studio allows this to be implicit.
gccdoes not.