home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / gnu / g / help / 1598 < prev    next >
Encoding:
Text File  |  1992-12-16  |  859 b   |  29 lines

  1. Xref: sparky gnu.g++.help:1598 comp.lang.c++:18062
  2. Path: sparky!uunet!mcsun!sunic!dkuug!diku!halgrim
  3. From: halgrim@diku.dk (Maz H. Spork)
  4. Newsgroups: uw.dcs.general,gnu.g++.help,comp.lang.c++
  5. Subject: Re: Deriving C++ Templates
  6. Message-ID: <1992Dec16.150157.10365@odin.diku.dk>
  7. Date: 16 Dec 92 15:01:57 GMT
  8. References: <1992Dec15.160544.26065@dcs.warwick.ac.uk>
  9. Sender: halgrim@freja.diku.dk
  10. Organization: Department of Computer Science, U of Copenhagen
  11. Lines: 16
  12.  
  13. You'll have to explicitly state in the derived class which type of the
  14. base class you want to use, ie:
  15.  
  16.    template <class C>
  17.       class Base<T> { };
  18.  
  19.    template <class C>
  20.       class Derived<C> : Base <C> { };
  21.  
  22. or similar, or simpler, like fewer template dependencies.
  23.  
  24. By the way, for good programming practice, consider deriving Matrix from
  25. Vector rather than the other way round...
  26.  
  27.  
  28. Maz
  29.