🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2165

Why not adopt gcc's "return" optimization?

#2165
From: David Arnstein
Date: Tue, 10 Oct 1995 19:56
19 lines
1171 bytes
Gcc's "return" extension to c++ looks like this:

   Integer  operator+  (const Integer& x, const Integer& y) return r
   {
     add(x, y, r);
   }

The "return r" clause in the first line prevents a copy of an Integer
object on function return.

Has the committee considered this extension?  It seems so sensible
that I wonder why it was never adopted.
-- 
David Arnstein       
arnstein@netcom.com  

[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <arnsteinDG8zHt.I0J@netcom.com>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: arnstein@netcom.com (David Arnstein)
Newsgroups: comp.std.c++
Subject: Why not adopt gcc's "return" optimization?
Date: 10 Oct 1995 19:56:14 GMT
Organization: North Coast Nest And Noodle Inn
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <arnsteinDG8zHt.I0J@netcom.com>
Reply-To: arnstein@netcom.com
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
Apparently-To: comp-std-c++@uunet.uu.net
Content-Length: 402
X-Lines: 15
Originator: clamage@taumet