J
Jim Luedtke
Can someone help me understand what might be going wrong here?
I'm writing a class template that looks something like this;
/* myclass.h */
#include<vector>
using namespace std
template <class ND>
class MyClass {
public:
vector<ND*> myvector;
vector<ND*>::iterator myit;
};
The problem is in the declaration of the iterator. When I compile, it
gives the error
syntax error before `;' token
for that line, then I get a long list of other meaningless errors.
There is no problem declaring the vector itself, and if I replace ND* in
the problem line with e.g. double*, then it has no problem with that
line, leading me to believe the syntax is actually OK. I am using g++
to compile this in Linux.
Any ideas?
Thanks!
I'm writing a class template that looks something like this;
/* myclass.h */
#include<vector>
using namespace std
template <class ND>
class MyClass {
public:
vector<ND*> myvector;
vector<ND*>::iterator myit;
};
The problem is in the declaration of the iterator. When I compile, it
gives the error
syntax error before `;' token
for that line, then I get a long list of other meaningless errors.
There is no problem declaring the vector itself, and if I replace ND* in
the problem line with e.g. double*, then it has no problem with that
line, leading me to believe the syntax is actually OK. I am using g++
to compile this in Linux.
Any ideas?
Thanks!