home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!nestroy.wu-wien.ac.at!d21.wu-wien.ac.at!h8850513
- From: h8850513@d21.wu-wien.ac.at (Michael Tesar)
- Newsgroups: comp.lang.c++
- Subject: classes
- Date: 22 Jan 1993 17:17:45 GMT
- Organization: Wirtschaftsuniversitaet Wien
- Lines: 29
- Distribution: world
- Message-ID: <1jpa7pINNac9@nestroy.wu-wien.ac.at>
- NNTP-Posting-Host: d21.wu-wien.ac.at
-
- Hello!
-
- I have a problem with my classes matrix and amatrix.
- Class matrix is for simple
- matrix operations, eg. multiplication
- In this class I have overloaded the operator*
-
- matrix operator*(matrix& mat);
-
- This class is working well and now I wanted to write a new class amatrix
- with all methodes of the matrix class - but I didnt like to change my
- matrix class. But in this new class I had to overload the operator* again.
-
- amatrix operator*(const double dvalue);
-
- But now I cannot use the multiplication of two amatrix objects.
-
- The only way to solve this problem - I know - is to write the function
- amatrix operator*(amatrix& mat);
- again, but I think this is not C++ like.
-
- Is there any possibility to avoid this dublication?
-
- Thank you,
-
- MichaeL
- C
- D
- Is there any possibility to avoid this dublication - better to--
-