home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zrz.tu-berlin.de!math.fu-berlin.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!stepsun.uni-kl.de!sun.rhrk.uni-kl.de!efes.physik.uni-kl.de!kring
- From: kring@efes.physik.uni-kl.de (Jochen Voss)
- Subject: classes for algebraic structures - need help
- Message-ID: <1992Aug17.145449.5259@rhrk.uni-kl.de>
- Sender: kring@efes.physik.uni-kl.de (Thomas Kettenring)
- Organization: FB Physik, Universitaet Kaiserslautern, Germany
- Date: Mon, 17 Aug 1992 14:54:49 GMT
- Lines: 24
-
- I want to implement some classes for groups, rings, ... . I wanted to write some abstract
- classes like
-
- class group {
- public:
- virtual group operator+(group) = 0;
- ...
- }
-
- and to derive classes for real groups like Z[2] ( {0,1}, 0+0 == 1+1 == 0, 0+1 == 1+0 == 1 ).
- But how do I do this: I want to override the operator+ with something like
-
- z2 operator+(z2);
-
- because only elements of type z2 (and not of type group) can be added to elements of type z2.
- How do I do this.
-
- Please mail me!
-
- --
- VinK - Voss is not Kring
-
- You can e-mail me at `kring@physik.uni-kl.de'.
- (use `c/o Jochen' in the Subject)
-