Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!sdd.hp.com!wuarchive!udel!haven!umbc3!gmuvax2!spark From: spark@gmuvax2.gmu.edu (Sooyong Park) Newsgroups: comp.lang.c++ Subject: Parameterized Types Simulation Keywords: c++ Message-ID: <3666@gmuvax2.gmu.edu> Date: 1 Mar 91 03:11:06 GMT Organization: George Mason Univ., Fairfax, Va. Lines: 36 HAVE YOU TRIED THE FOLLOWING? As far as I know, C++ does not provide parameterized types. Is there any way we can simulate parameterized types ? For example, to build a class for LIST which has a generic type, I may program as follows. Please tell me your way of doing so. class INT_LIST : public LIST { ... ... put(int val) { ..} ... } class CHAR_LIST : public LIST { ... put(char val){ .. } where, class LIST { ... LIST(int n) { new gentype[n] } put(gentype val) { ... } ... } Many thanks in advance. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= EMail: spark@gmuvax2.gmu.edu USMail: Sooyong Park Computer Science George Mason Univ Fairfax, VA 22030