Article View: comp.std.c++
Article #2328Re: Q: is A a = 100; equivalent to A a (10
From: Alex Martelli
Date: Fri, 27 Oct 1995 18:20
Date: Fri, 27 Oct 1995 18:20
23 lines
1671 bytes
1671 bytes
clamage@Eng.Sun.COM (Steve Clamage) writes: ... >It is sometimes also necessary to point out the difference between copy >construction and copy assignment. > // T is a type, and x is not type T > T t1 = x; // may omit a temp T and avoid copying it > T t2; > t2 = x; // must create a temp T and assign it to t2 This only applies if class T does not define an "operator=(X const&)" (or, similar ones taking an X or an X&), where x's type is X, right? Alex -- DISCLAIMER: these are TOTALLY personal opinions and viewpoints, NOT connected in any way with my employer, nor any other organization or individual! Email: martelli@cadlab.it Phone: +39 (51) 597313 CAD.LAB s.p.a., v. Ronzani 7/29, Casalecchio, Italia Fax: +39 (51) 597120 --- [ 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:
<martelli.814802135@cadlab>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backReferences:
<9529918.27354@mulga.cs.mu.OZ.AU> <46o89m$n9d@engnews2.Eng.Sun.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 27 Oct 95 18:20:35 GMT Approved: fjh@cs.mu.oz.au Sender: news@cadlab.it Newsgroups: comp.std.c++ From: martelli@cadlab.cadlab.it (Alex Martelli) Subject: Re: Q: is A a = 100; equivalent to A a (10 Message-ID: <martelli.814802135@cadlab> X-Newsreader: NN version 6.5.0 #11 Organization: Cad.Lab Spa, Bologna, Italia Sender: news@cadlab.it References: <9529918.27354@mulga.cs.mu.OZ.AU> <46o89m$n9d@engnews2.Eng.Sun.COM> X-Original-Date: Fri, 27 Oct 1995 13:55:35 GMT X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMJEi/eEDnX0m9pzZAQEXSgGAiBEHR+2tkZbDSAArqFv7SoZ4ht7iDJKs IwSlggWm+RbtYmIplFrmNr3A10CDTZX7 =pfXs