🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: double& rd2 = 2.0; // error?

#3556
From: Steve Clamage
Date: Thu, 29 Feb 1996 22:06
25 lines
1716 bytes
In article 87E@cteq07.pa.msu.edu, David Bowser-Chao <davechao@cteq07.pa.msu.edu> writes:
>Looking at the April 1995 working draft proposal,
>the fragment:

>   double& rd2 = 2.0; 

>is deemed illegal (non-const references are not initialized from 
>temporaries) but the GNU g++ 2.7.2 as well as the DEC VMS compiler 
>(current release, don't remember, as well as the version I'm 
>field-testing) allow this statement with a mere warning.

The current draft says the same thing, with the same example.

Some compilers allow such reference binding for compatibility with
old compilers which incorrectly allowed it.

---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]
Technical Details
Message-ID: <4h4uvs$3m6@engnews1.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern
References: <3135D175.87E@cteq07.pa.msu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern
From: clamage@Eng.Sun.COM (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: double& rd2 = 2.0;  // error?
Date: 29 Feb 1996 14:06:44 PST
Organization: Sun Microsystems Inc.
Approved: austern@isolde.mti.sgi.com
Message-ID: <4h4uvs$3m6@engnews1.Eng.Sun.COM>
References: <3135D175.87E@cteq07.pa.msu.edu>
Reply-To: clamage@Eng.Sun.COM
NNTP-Posting-Host: isolde.mti.sgi.com
X-Original-Date: 29 Feb 1996 19:32:12 GMT
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBVAwUBMTYjhky4NqrwXLNJAQHeoQH/Rqq6ww0vUO3seozBdQD0u/UJLqql3Qjq
 itIaWAFEqocjQgfLqh9PDJFH0m9vqHrf2o4woqYLnNOLc8Loj8vwPA==
 =ZB59
Originator: austern@isolde.mti.sgi.com