From: jpmorgan AT unm DOT edu (James Paul Morgan) Subject: Re: problem with inner classes in template functions 22 May 1997 20:00:58 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Original-To: Oliver Glier Original-cc: gnu-win32 AT cygnus DOT com In-Reply-To: <3382BFCB.89F0591C@stud.uni-frankfurt.de> Original-Sender: owner-gnu-win32 AT cygnus DOT com On Wed, 21 May 1997, Oliver Glier wrote: [Code SNIP of a class in the public area of a template class.] > > The compiler always yields a syntax error at the line with... [SNIP] > Still, I think that > code as above is correct C++. At least it works with a lot > of other C++ compilers and seems to be important in the > use of class libraries such as STL. > I've had similar problems with the g++ compiler under Cygwin32 17.1 with a class inside of a normal class. It was for a school project and compiled successfully on the g++ compiler on UNM's AIX machine. For some reason, Cygwin's g++ does not like a class within another class. My situation was that the the sub-class was declared inside the private portion of the main class. The sub-class was only used in the constructor of the main class and nowhere else. However, the compiler on Cygwin32 complained that the sub-class was private when it was accessed. (Yes, I know that declaring in a class in private that is only used in the constructor is very odd, but that's the kind of code this professor wrote and wanted us to use.) I have created other classes within classes in other school projects and seen it in text books, so I figure it's valid C++, but Cygwin doesn't always accept it. See ya around the Mulberry bush. --James :) - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".