Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!well!nagle From: nagle@well.sf.ca.us (John Nagle) Newsgroups: comp.lang.c++ Subject: Re: About Lists and things ... Mostly requests for info. Message-ID: <25632@well.sf.ca.us> Date: 24 Jun 91 01:17:33 GMT References: <18939@prometheus.megatest.UUCP> <68070004@hpcupt1.cup.hp.com> Lines: 25 It's frustrating. C++ has classes but not generics. Ada has generics but not classes. Pascal and Modula (I and II) have neither. The languages that have both tend to have too much other excess baggage at run time. Another level of preprocessor is not the answer. (Some C++ implementations now have three preprocessors; template to C++, C++ to C, and standard C preprocessing.) Generics as part of the language seem the right approach. It's straightforward to determine when the generic is instantiated if the same code used for another instantiation can be reused. You get full type safety and no extra run-time overhead either in space or time. So this seems the approach of choice. Resolving multiple instantiations in separate complilations is possible at link time if name mangling for generic parameterized types results in the type of the formal, rather than the actual, type parameter being used in the mangled name in circumstances where code reuse is possible. So if you have two copies of the "list" routines because the list class was instantiated twice in different files, they will result in routines with the same name and the duplicate can be dropped at link time. What's the current proposal from the standards people? John Nagle