Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!snorkelwacker!apple!sun-barr!newstop!sun!gzilla!jjg From: jjg@gzilla.Sun.COM (Jonathan Gibbons) Newsgroups: comp.lang.c++ Subject: typedef'ed class declarations Keywords: typedef class Message-ID: <130625@sun.Eng.Sun.COM> Date: 24 Jan 90 01:39:35 GMT Sender: news@sun.Eng.Sun.COM Lines: 33 One for the language lawyers ... I have a macro to emulate parameterized types: param_type(C,T). It expands into a class declaration such that I can use it as follows typedef param_type(List,String) Strings; which might not be so different from typedef List[String] Strings; if ever we get parameterized types in C++. The macro for the above example expands into something like typedef class tmp { ... } Strings; That is fine and works, but it is convenient at one point in one header to be able to go class Strings; before the above macro expansion. cfront is happy to have the two definitions co-exist, g++ isn't. It seems the typedef in g++ doesn't do what I expected, which was to declare Strings as the name of the class, as though it were declared typedef Strings { ... } Am I being optimistic in expecting this to work at all, or is g++ to be considered at fault? -- Jon Gibbons jjg@sun.com