Article View: comp.std.c++
Article #2263Re: Q: is A a = 100; equivalent to A a (100); ?
From: Damian Conway
Date: Thu, 19 Oct 1995 22:43
Date: Thu, 19 Oct 1995 22:43
30 lines
2389 bytes
2389 bytes
Various people explore various copy initialization scenarios and the rationale
for allowing optimization back to direct construction:
[deleted]
I still haven't seen a convincing explanation (pace Steve) as to why the WP
differentiates so clearly between direct and copy initialization semantics
when the real situation is (or appears to be) that direct initialization
_may_ be used in all cases, at the discretion of the compiler.
Sure, leaving the compiler the freedom to optimize out unneeded temporaries
is probably a Good Thing, even at the expense of predictability, but why
not simply word the description to reflect the fact that, when using _either_
the "()" or the "=" form of initialization, temporaries of various types
_may_ be generated (with the constraint that the direct initialization form
will not generate temporaries of the type being initialized)?
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:
<damian.814134316@molly.cs.monash.edu.au>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backReferences:
<JLM.95Oct12202250@ludo.two-oo-one.fr> <u9burle2pv.fsf@yorick.cygnus.com> <45skdo$cm4@engnews2.Eng.Sun.COM> <45sl3a$coc@engnews2.Eng.Sun.COM> <9510161109.AA08959@slsvgqt.lts.sel.alcatel.de> <damian.813960961@molly.cs.monash.edu.au> <4638jp$ef4@fsgm01.fnal.gov> <MATT.95Oct18111956@godzilla.EECS.Berkeley.EDU> <463tln$hmm@fsgm01.fnal.gov>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 19 Oct 95 22:43:34 GMT Approved: fjh@cs.mu.oz.au X-Original-Date: Thu, 19 Oct 1995 20:25:16 +0000 (GMT) From: damian@molly.cs.monash.edu.au (Damian Conway) Subject: Re: Q: is A a = 100; equivalent to A a (100); ? Message-ID: <damian.814134316@molly.cs.monash.edu.au> Organization: Monash University Newsgroups: comp.std.c++ References: <JLM.95Oct12202250@ludo.two-oo-one.fr> <u9burle2pv.fsf@yorick.cygnus.com> <45skdo$cm4@engnews2.Eng.Sun.COM> <45sl3a$coc@engnews2.Eng.Sun.COM> <9510161109.AA08959@slsvgqt.lts.sel.alcatel.de> <damian.813960961@molly.cs.monash.edu.au> <4638jp$ef4@fsgm01.fnal.gov> <MATT.95Oct18111956@godzilla.EECS.Berkeley.EDU> <463tln$hmm@fsgm01.fnal.gov> X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMIbVMOEDnX0m9pzZAQGZxAGAmIZlMz0mYMO/5k3E++IdV9z12w71P+wd 6VcIYHc4EF8yPrTNA+wNavPcRdRGpBF4 =9jq7