C4346: dependant name is not a type.

B

bvm

Not sure of the best way to go about this but I have a
question to ask/bug to report.

#include <list>
using namespace std;

template< class __type >
class Brian {
list< __type > *vert;
list< __type >::iterator end;
};

Fails to compile with the offending line being list<
__type >::iterator end; To my knowlegde this should
compile. Tried on gcc 3.x it compiles without a hitch.
So am i doing something wrong here or is this indeed a
glitch and if so, is there a service pack? I'm using
msvc++7.1 that cames with visual studio.net 2003.

So what can you tell me. Are there work arounds, upgrades?

Thanks, brian.
 
C

Carl Daniel [VC++ MVP]

bvm said:
Not sure of the best way to go about this but I have a
question to ask/bug to report.

#include <list>
using namespace std;

template< class __type >
class Brian {
list< __type > *vert;
list< __type >::iterator end;

typename list said:
};

Fails to compile with the offending line being list<
__type >::iterator end; To my knowlegde this should
compile. Tried on gcc 3.x it compiles without a hitch.
So am i doing something wrong here or is this indeed a
glitch and if so, is there a service pack? I'm using
msvc++7.1 that cames with visual studio.net 2003.

So what can you tell me. Are there work arounds, upgrades?

The compiler is correct - the code isn't legal as you've shown it here.

Also, you shouldn't be using names that being with _ (let alone __) in your
code - they're reserved to the implementation.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top