Path: utzoo!attcan!uunet!mcvax!cernvax!ethz!marti From: marti@ethz.UUCP (Robert Marti) Newsgroups: comp.lang.c++ Subject: Re: "Inheritance" of operator=() Summary: "inherited" assignment does make sense Keywords: user error or cfront error? Message-ID: <933@ethz.UUCP> Date: 17 May 89 16:18:06 GMT References: <863@ethz.UUCP> <11519@ulysses.homer.nj.att.com> Organization: ETH Zuerich Lines: 30 In article <11519@ulysses.homer.nj.att.com>, jss@hector.UUCP (Jerry Schwarz) writes: > Assignment is special because it is defined for all classes, (thus it > never needs to be inherited). > > But the meaning of assignment has changed between 1.2 and 2.0. In 1.2 > the synthesized assignment operator was always "bitwise copy". This > was seen to be wrong and in 2.0 assignment is defined to be > "recursive". I am glad to hear that the semantics of (user-defined) assignment has changed in 2.0, although I am not quite sure what you mean when you say that it is defined to be "recursive". Could you elaborate on that? > Note that it doesn't make much sense to just "inherit" assignment > because that would mean that the added members of D wouldn't > participate in assignment of D. Since 1.2 didn't implement a > "recursive" assignment, and a bitwise copy would clearly be wrong. ^^^^^ seems superfluous to me(?) Well, in my example, no additional data members were defined in the derived class, so bitwise copy would definitely make sense! -- Robert Marti Phone: +41 1 256 52 36 Institut fur Informationssysteme ETH-Zentrum CSNET/ARPA: marti%inf.ethz.ch@relay.cs.net CH-8092 Zurich, Switzerland UUCP: ...uunet!mcvax!ethz!marti