home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / gnu / g / help / 1592 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  1.0 KB

  1. Xref: sparky gnu.g++.help:1592 comp.lang.c++:17994
  2. Newsgroups: uw.dcs.general,gnu.g++.help,comp.lang.c++
  3. Path: sparky!uunet!stanford.edu!agate!doc.ic.ac.uk!warwick!dcs.warwick.ac.uk!jas
  4. From: jas@dcs.warwick.ac.uk (Jason Morris)
  5. Subject: Deriving C++ Templates
  6. Message-ID: <1992Dec15.160544.26065@dcs.warwick.ac.uk>
  7. Sender: news@dcs.warwick.ac.uk (Network News)
  8. Nntp-Posting-Host: quartz
  9. Organization: Department of Computer Science, Warwick University, England
  10. Date: Tue, 15 Dec 1992 16:05:44 GMT
  11. Lines: 11
  12.  
  13.  
  14.   I have a C++ class, Matrix, and from this I derived a class, Vector, which
  15. is simply a 1-D Matrix. The problem was that I could only have a Matrix of,
  16. say floats, but I wanted something more flexible that could hold anything. So
  17. I changed Matrix to be a template with the type of element given as the
  18. template arguement. That works fine.
  19.   However, I am now having problems in deriving Vector. Is it actually
  20. possible to use a template as a base class? Or are parameterised types and
  21. inheritance mechanisms mutually exlusive? 
  22.  
  23.     Jas.
  24.