Xref: utzoo comp.lang.c++:6410 gnu.g++:642 gnu.g++.bug:1440 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!brutus.cs.uiuc.edu!jarthur!uci-ics!rfg From: rfg@ics.uci.edu (Ronald Guilmette) Newsgroups: comp.lang.c++,gnu.g++,gnu.g++.bug Subject: Re: Typedefs in class declarations. Keywords: typedef class Message-ID: <25D3DCB8.16923@paris.ics.uci.edu> Date: 10 Feb 90 09:19:52 GMT References: <6016@cadillac.CAD.MCC.COM> Reply-To: rfg@ics.uci.edu (Ronald Guilmette) Organization: UC Irvine Department of ICS Lines: 25 In article <6016@cadillac.CAD.MCC.COM> ned@MCC.COM (Ned Nowotny) writes: >What, if anything, is special about typedefs which are enclosed within a class >declaration? G++ 1.36.4 does not recognize typedef names outside the scope >of an enclosing class declaration and I am not enough of a language lawyer >to know whether this is really a problem. Currently, g++ treats class-nested typedefs as local to the containing class. This is certainly different from what cfront 2.0 currently does. Whether it is a problem or not depends on what you are trying to do. Little incompatabilities like this are always mildly irritating however. I have mentioned this difference to MDT and I believe that he is disinclined to change the g++ treatement at this time. Part of his reasoning may be that there have been some suggestions made regarding rule changes for class- nested types. I think he would prefer to wait and see what happens there. (But I should not be speaking for him.) >I do know, however, that you >can't declare something as a classname::typedef. Therefore, it would seem that >G++'s behavior is either a bug, or typedefs within class declarations are >nearly useless. They may be useful within the class. Think encapsulation! // rfg