C4346: dependant name is not a type.

  • Thread starter Thread starter bvm
  • Start date Start date
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.
 
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
 
Back
Top