Why doesn't the following compile in Visual Studio 2003?
GCC compiles it without any errors.
class Outter
{
public:
// First inner class:
template class Inner1
{
};
// Second Inner class:
class Inner2
{
public:
// Method definition:
Outter* Inner1()
{
}
};
};
The error given is:
Debugger.cpp(16): error C2955: 'Outter::Inner1' : use of class template requires template argument list
And is on this line:
// Method definition:
Outter* Inner1()
So it seems that the compiler confuses the method definition with the previous class deffinition having the same name (Inner1). But why should it?
I also asked this on the VC forums forums.microsoft.com but I got no satisfactory answer till now.
Note: The online forum software is horrible.
Note2: Where are the old good newsgroups for Visual C++. I can find MS newsgroups for almost anything but not for Visual Studio and the languages. Amaizing!
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.