Article View: gnu.g++.lib.bug
Article #562Should "operator =" be made to return *this, by convention?
From: Tom Ngo
Date: Sat, 03 Feb 1990 04:42
Date: Sat, 03 Feb 1990 04:42
11 lines
851 bytes
851 bytes
C programmers are accustomed to expecting = to return the value
assigned. However, in a few classes--for example, String, Integer
and Rational-- operator == returns void. Is there a good reason
for this? Could they be made to return String&, Integer& and
Rational& *this without causing problems?
Apologies if this has been brought up before...
--Tom Ngo
ngo@harvard.edu
Technical Details
Message-ID:
<9002030548.AA00886@life.ai.mit.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!HARVARD.HARVARD.EDU!ngo%tammyShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!HARVARD.HARVARD.EDU!ngo%tammy From: ngo%tammy@HARVARD.HARVARD.EDU (Tom Ngo) Newsgroups: gnu.g++.lib.bug Subject: Should "operator =" be made to return *this, by convention? Message-ID: <9002030548.AA00886@life.ai.mit.edu> Date: 3 Feb 90 04:42:54 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 11