Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!bellcore!rruxh!aaron From: aaron@rruxh.UUCP (Akman) Newsgroups: comp.lang.c++ Subject: C++ Question/Dewhurst Message-ID: Date: 5 Jun 90 17:20:30 GMT Sender: news@bellcore.bellcore.com Distribution: comp Organization: Bellcore Lines: 24 I'm reading the Dewhurst, Stark text on C++, and I have a question re Genericity: I gather, from pp. 88-91, that using generic.h macros to fake genericity is a standard way of doing business? That doesn't seem too pleasant to me...for the example discussed it would also be possible to have a common base class for all things that you'd like to be able to have collections of, and virtual base functions (I might be misusing the terms) could be redefined in each of the classes. Like this: THING is an object, String is a THING and Complex is a THING. Then declare a collection of THINGs and insert Strings into it, or insert Complexes into it (as the case may be). This method seems less annoying to me and you could keep lots of common things in THING; the disadvantabe I see is that you couldn't have "regular" types like char, int, double have THING as a base class, so you'd have to invent myint, mydouble, etc. Any thoughts from someone who has done this a bit? -- ----------- Aaron Akman, 201-699-8019, bellcore!rruxh!aaron, RRC 4D-728