Path: utzoo!attcan!uunet!samsung!usc!elroy.jpl.nasa.gov!ames!amdahl!pacbell!well!nagle From: nagle@well.sf.ca.us (John Nagle) Newsgroups: comp.lang.c++ Subject: What to do about generics and polymorphism in C++ Message-ID: <16808@well.sf.ca.us> Date: 22 Mar 90 05:11:24 GMT Reply-To: nagle@well.UUCP (John Nagle) Lines: 27 Let's start a discussion about the problem of how to achieve generic objects (ones with types as parameters, at least at compile time) in C++. Some possibilities: 1. Explicitly use "pointer to void". Works, but violates type safety and requires much repetitive writing. 2. Encapsulate the necessary messy definitions in preprocessor defines, as shown in "The C Answer Book". Ugly and tends to produce confusing error messages when trouble occurs. May not be type safe. 3. Add compile-time generic facilities along the lines of those in Ada to the language. Provides similar functionality to #2, with proper checking and diagnostics, but requires a language change. 4. Add types as first-class objects, as in Smalltalk, so that one can have type-valued variables and can do declarations at run time. 5. Other? Comments? John Nagle