Structure + Function Templates + MSVC 6 C2062 Error!

J

Jay

Hi All,

If we define a template function within a structure and when calling
the function if we specify the typename, MSVC6 throws an error saying
that typename was not expected (Error C2062). If we don't specify the
typename, then everything works fine. But, the same problem is not
noticed in g++ in linux. What is the reason?

Thanks in Advance!

Regards,
Jayaraghavendran.K
 
D

Dave Rahardja

Hi All,

If we define a template function within a structure and when calling
the function if we specify the typename, MSVC6 throws an error saying
that typename was not expected (Error C2062). If we don't specify the
typename, then everything works fine. But, the same problem is not
noticed in g++ in linux. What is the reason?

Thanks in Advance!

Regards,
Jayaraghavendran.K

Some sample code might help here.
 
F

FabioAng

Jay said:
Hi All,

If we define a template function within a structure and when calling
the function if we specify the typename, MSVC6 throws an error saying
that typename was not expected (Error C2062). If we don't specify the
typename, then everything works fine. But, the same problem is not
noticed in g++ in linux. What is the reason?

Thanks in Advance!

Regards,
Jayaraghavendran.K

Probably because MSVC6 is not ISO C++ compliant.

Fabio
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

Hi All,

If we define a template function within a structure and when calling
the function if we specify the typename, MSVC6 throws an error saying
that typename was not expected (Error C2062). If we don't specify the
typename, then everything works fine. But, the same problem is not
noticed in g++ in linux. What is the reason?

When something does not work in VC6 but in some other, newer compiler I
usually assume that it's because VC6 sucks (it's 9 years old now) but
just to be sure I'd run the code through comeau online just to be sure.
If you can, get a newer compiler, Visual C++ 2005 Express is available
for free from www.microsoft.com.
 
V

VinaySGudur

Right ! MSVC6 is not ISO C++ compliant. This problem gets solved in
higher versions of MSVC6


-Vinay Gudur
 
R

red floyd

Right ! MSVC6 is not ISO C++ compliant. This problem gets solved in
higher versions of MSVC6

There *are no* higher versions of MSVC6. There are, however higher
versions of MSVC (current version is 8).
 

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

Members online

Forum statistics

Threads
474,291
Messages
2,571,468
Members
48,142
Latest member
annawelson

Latest Threads

Top