home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!mips!darwin.sura.net!wupost!m.cs.uiuc.edu!sunb10.cs.uiuc.edu!sparc10.cs.uiuc.edu!pjl
- From: pjl@sparc10.cs.uiuc.edu (Paul Lucas)
- Subject: Re: A template question
- Message-ID: <1992Aug19.163921.25153@sunb10.cs.uiuc.edu>
- Keywords: template, BC++ 3.1
- Sender: news@sunb10.cs.uiuc.edu
- Organization: University of Illinois at Urbana-Champaign
- References: <Bt84JC.En0@zorch.SF-Bay.ORG>
- Distribution: usa
- Date: Wed, 19 Aug 1992 16:39:21 GMT
- Lines: 33
-
- In <Bt84JC.En0@zorch.SF-Bay.ORG> pchi@zorch.SF-Bay.ORG (Eric Chi) writes:
-
- >Hi, I am using Borland C++ 3.1 implementing 2 classes: vector and matrix.
- >I have the Vector class defined as a template:
-
- > template <class Type>
- > class Vector
- > {
- > public:
- > Vector( int dim);
- > ...
- > };
-
- >Now I tried to define the matrix by utilizing the vector:
-
- > template <class Type>
- > class Matrix: public Vector< Vector< Type>>
- > {
- > ....
- > };
-
- >Is this a correct way? Borland C++ seems do not understand the syntax.
-
- class Matrix : public Vector< Vector< Type > >
- ^
- |
- space required
-
- Otherwise '>>' is the right-shift operator.
- --
- - Paul J. Lucas University of Illinois
- AT&T Bell Laboratories at Urbana-Champaign
- Naperville, IL pjl@cs.uiuc.edu
-