Article View: gnu.g++
Article #218named return value [was: Defining operators]
From: Michael Tiemann
Date: Tue, 28 Nov 1989 15:01
Date: Tue, 28 Nov 1989 15:01
12 lines
924 bytes
924 bytes
But seriously, what if operator+ is used inside an expression in this new
case? Then the compiler generates a temp on its own, I guess..
e.g.: A=(b+c)*2;
In fact, it does generate a temporary. But you missed the point. The
point was to avoid needless copying objects, not to avoid the creation
of temporaries. It is often the case that copy elimination avoids
temporary creation, but not always.
Michael
Technical Details
Message-ID:
<8911281501.AA29237@lurch.Stanford.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!LURCH.STANFORD.EDU!tiemannReferences:
<650@alias.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!LURCH.STANFORD.EDU!tiemann From: tiemann@LURCH.STANFORD.EDU (Michael Tiemann) Newsgroups: gnu.g++ Subject: named return value [was: Defining operators] Message-ID: <8911281501.AA29237@lurch.Stanford.EDU> Date: 28 Nov 89 15:01:51 GMT References: <650@alias.UUCP> Sender: daemon@tut.cis.ohio-state.edu Reply-To: tiemann@lurch.stanford.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 12