home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!spool.mu.edu!umn.edu!csus.edu!netcom.com!netcomsv!ulogic!hartman
- From: hartman@ulogic.UUCP (Richard M. Hartman)
- Newsgroups: comp.lang.c++
- Subject: Re: Who is wrong? me, BC , GNUC ?
- Message-ID: <748@ulogic.UUCP>
- Date: 18 Dec 92 01:18:09 GMT
- References: <1992Dec8.184713.7544@taumet.com> <718@ulogic.UUCP> <1992Dec14.172921.18638@cci632.cci.com>
- Organization: negligable
- Lines: 27
-
- So it is then impossible to selectively override one of a set
- of inheirited functions of the same name. In order to accomplish
- this we have to override the one we want, the put "passthrough"
- inline member functions in for the rest, e.g.:
-
- class A {
- A &operator += (A &);
- A &operator += (int);
- };
-
- class B : public A {
- {
- B &operator += (int);
- A &operator += (A &a) { return *((A *) this) += a; }
- };
-
- is this an accurate summary?
-
- (the inline may perhaps need a different declaration:
- A &operator += (A &a) { return A::operator+=(a); }
- I really haven't tried this....)
-
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Between the silence of the mountains |
- and the crashing of the sea | -Richard Hartman
- there lies a land I once lived in | hartman@uLogic.COM
- and she's waiting there for me. |
-