home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11565 < prev    next >
Encoding:
Text File  |  1992-07-25  |  1.1 KB  |  34 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mole-end!mat
  3. From: mat@uunet.uu.net!mole-end
  4. Subject: Re: template argument as base class
  5. Message-ID: <1992Jul26.025942.6471@uunet.uu.net!mole-end>
  6. Organization: :
  7. References: <20204@sbsvax.cs.uni-sb.de> <1992Jul24.195032.14884@delfin.com>
  8. Date: Sun, 26 Jul 1992 02:59:42 GMT
  9. Lines: 23
  10.  
  11. In article <1992Jul24.195032.14884@delfin.com>, kinne@delfin.com (Kinne Strong) writes:
  12. > stefan@mpi-sb.mpg.de (Stefan Naeher) writes:
  13.  
  14. > : template <class T> class XYZ : public T { };
  15. > : cfront says
  16. > : "sorry, not implemented: formal type parameter T used as base class of
  17. > : template"
  18.  
  19. > : A possible application is the implementation of data types with
  20. > : implementation parameters, e.g., dictionary<skiplist>,
  21. > : dictionary<red_black_tree>, ....
  22.  
  23. > It sounds to me like what you really want is inheritance and virtual
  24. > functions. ...
  25.  
  26. Inheritance can allow the smarts of the implementation to be shared, but
  27. genericity (parameterization, in C++: templates) is necessary to put a
  28. typesafe wrapper around it.
  29. -- 
  30.  (This man's opinions are his own.)
  31.  From mole-end                Mark Terribile
  32.  
  33.  uunet!mole-end!mat, Somewhere in Matawan, NJ
  34.