🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Q: is A a = 100; equivalent to A a (100); ?

#2209
From: Damian Conway
Date: Mon, 16 Oct 1995 03:43
29 lines
1610 bytes
jason@cygnus.com (Jason Merrill) and other cogniscenti write:

>> | According to the standard, are the two lines of the main
>> | equivalent ? My Opinion is yes

>No.

Then is it possible to set up a class X wherein:

	X x(1);
and
	X x = 1;

behave differently?

Or is the compiler always allowed to optimize away the temporary and copy 
constructor, even if that changes the semantics of the program?

damian
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  who: Damian Conway                 email: damian@bruce.cs.monash.edu.au
where: Dept. Computer Science        phone: +61-3-565-5184
       Monash University               fax: +61-3-565-5146
       Clayton 3168                  quote: "A pessimist is never disappointed."
       AUSTRALIA

[ 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: <45skdo$cm4@engnews2.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
References: <JLM.95Oct12202250@ludo.two-oo-one.fr> <u9burle2pv.fsf@yorick.cygnus.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: damian@molly.cs.monash.edu.au (Damian Conway)
Newsgroups: comp.std.c++
Subject: Re: Q: is A a = 100; equivalent to A a (100); ?
Date: 16 Oct 1995 03:43:52 GMT
Organization: Monash University
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <45skdo$cm4@engnews2.Eng.Sun.COM>
References: <JLM.95Oct12202250@ludo.two-oo-one.fr>
 <u9burle2pv.fsf@yorick.cygnus.com>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: molly.cs.monash.edu.au
Content-Length: 781
Originator: clamage@taumet