home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 17813 next >
Encoding:
Text File  |  1992-12-11  |  800 b   |  40 lines

  1. Path: sparky!uunet!usc!news.service.uci.edu!network.ucsd.edu!sdcc12!sdcc3!acanter
  2. From: acanter@sdcc3.ucsd.edu (Adriaan Canter)
  3. Newsgroups: comp.lang.c++
  4. Subject: Templates
  5. Keywords: Template Inheritance
  6. Message-ID: <42406@sdcc12.ucsd.edu>
  7. Date: 11 Dec 92 16:59:32 GMT
  8. Sender: news@sdcc12.ucsd.edu
  9. Distribution: ca
  10. Lines: 27
  11. Nntp-Posting-Host: sdcc3.ucsd.edu
  12.  
  13.  
  14. I've read the FAQ, but I don't have a compiler supporting templates.
  15. Does the following code work, or does Vector have to be templated
  16. with a pre-defined Type before I can inherit from a class of Vector
  17. of Vector of Type?
  18.  
  19. template<class Type>
  20. class Vector {
  21.  
  22.        .
  23.        .
  24.        .
  25.        .
  26.        .
  27. };
  28.  
  29. template <class Type>
  30. class Matrix : public Vector < Vector <Type> > {
  31.        .
  32.        .
  33.        .
  34.        .
  35.        .
  36.        .
  37. };
  38.  
  39.  
  40.