Article View: comp.std.c++
Article #2222Re: Q: is A a = 100; equivalent to A a (100); ?
From: kanze
Date: Mon, 16 Oct 1995 16:47
Date: Mon, 16 Oct 1995 16:47
43 lines
1972 bytes
1972 bytes
In article <45sl3a$coc@engnews2.Eng.Sun.COM> clamage@Eng.sun.com
(Steve Clamage) writes:
|> damian@molly.cs.monash.edu.au (Damian Conway) writes:
|> >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?
|> Yes. Silly example: Write a message to the terminal from the copy
|> constructor. If the copy is optimized away, you won't see the message.
I don't think that is what he was looking for. As far as I know,
there is no way of *ensuring* that the above will both be legal, but
have garanteed different run-time semantics.
It is trival to make the first legal, and the second illegal, which, I
suppose is a way of making them behave differently at compile time.
--
James Kanze Tel.: (+33) 88 14 49 00 email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
Conseils en informatique industrielle --
-- Beratung in industrieller Datenverarbeitung
---
[ 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:
<9510161109.AA08959@slsvgqt.lts.sel.alcatel.de>Path:
arc1-ca.pugleaf.net!128.32.155.1!mattReferences:
<JLM.95Oct12202250@ludo.two-oo-one.fr> <u9burle2pv.fsf@yorick.cygnus.com> <45skdo$cm4@engnews2.Eng.Sun.COM> <45sl3a$coc@engnews2.Eng.Sun.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt From: kanze <kanze@lts.sel.alcatel.de> Newsgroups: comp.std.c++ Subject: Re: Q: is A a = 100; equivalent to A a (100); ? Date: 16 Oct 1995 16:47:31 GMT Organization: <none> Approved: matt@physics2.Berkeley.EDU (Matt Austern) Message-ID: <9510161109.AA08959@slsvgqt.lts.sel.alcatel.de> 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> NNTP-Posting-Host: physics2.berkeley.edu