Article View: comp.std.c++
Article #2181Re: Q: is A a = 100; equivalent to A a (100); ?
From: John Max Skaller
Date: Sun, 15 Oct 1995 07:58
Date: Sun, 15 Oct 1995 07:58
33 lines
1554 bytes
1554 bytes
jlm@two-oo-one.fr (Jean-Louis Moser) wrote:
>| According to the standard, are the two lines of the main
>| equivalent ?
>#include <iostream.h>
>
>class A {
>public:
> A (int i) {cout << "A" << endl;}
>private:
> A (const A&) {cout << "COPY" << endl;}
>};
>
>void main ()
>{
> A a1 (100);
> A a2 = 99;
>}
The two lines are NOT equivalent. The second line is
in error, the copy ctor is private but is required,
no copy ctor is required for the first line. [Gak]
--
John Max Skaller voice: 61-2-566-2189
81 Glebe Point Rd fax: 61-2-660-0850
GLEBE NSW 2037 email: maxtal@suphys.physics.oz.au
AUSTRALIA email: skaller@maxtal.com.au
---
[ 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:
<45qd0u$sk9@oznet03.ozemail.com.au>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backReferences:
<JLM.95Oct12202250@ludo.two-oo-one.fr>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 15 Oct 95 07:58:18 GMT Approved: fjh@cs.mu.oz.au From: John Max Skaller <maxtal@suphys.physics.su.oz.au> Newsgroups: comp.std.c++ Subject: Re: Q: is A a = 100; equivalent to A a (100); ? X-Original-Date: 15 Oct 1995 07:25:18 GMT Organization: MAXTAL Message-ID: <45qd0u$sk9@oznet03.ozemail.com.au> References: <JLM.95Oct12202250@ludo.two-oo-one.fr> X-Mailer: Mozilla 1.2N (Windows; I; 16bit) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMIC/LOEDnX0m9pzZAQHt6AGAo3WDG6m1NTkBsax96OHEC1b40BdzUKE+ 0Xc2gg31KlOYDf3NCXqWaEUUZklV41VW =F0RZ