Path: 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 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 Brought to you by Super Global Mega Corp .com