home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12548 < prev    next >
Encoding:
Text File  |  1992-08-19  |  763 b   |  34 lines

  1. Path: sparky!uunet!charon.amdahl.com!amdahl!rtech!pacbell.com!tandem!zorch!pchi
  2. From: pchi@zorch.SF-Bay.ORG (Eric Chi)
  3. Newsgroups: comp.lang.c++
  4. Subject: A template question
  5. Keywords: template, BC++ 3.1
  6. Message-ID: <Bt84JC.En0@zorch.SF-Bay.ORG>
  7. Date: 19 Aug 92 09:18:47 GMT
  8. Distribution: usa
  9. Organization: SF-Bay Public-Access Unix
  10. Lines: 22
  11.  
  12. Hi, I am using Borland C++ 3.1 implementing 2 classes: vector and matrix.
  13. I have the Vector class defined as a template:
  14.  
  15.     template <class Type>
  16.     class Vector
  17.     {
  18.     public:
  19.         Vector( int dim);
  20.     ...
  21.     };
  22.  
  23. Now I tried to define the matrix by utilizing the vector:
  24.  
  25.     template <class Type>
  26.     class Matrix: public Vector< Vector< Type>>
  27.     {
  28.     ....
  29.     };
  30.  
  31. Is this a correct way? Borland C++ seems do not understand the syntax.
  32.  
  33. Eric.
  34.