From -1160314889317767166
X-Google-Thread: f78e5,51456c3eb8f9490e
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII
Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!news.tiscali.de!newsfeed.hanau.net!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: hofmann@anvil-soft.com ("Matthias Hofmann")
Newsgroups: comp.std.c++
Subject: Re: Copy Constructor Confusion!
Date: Sat, 26 Aug 2006 20:30:15 GMT
Lines: 65
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <4lb16sF130luU1@individual.net>
References: <1155645873.296811.3890@74g2000cwt.googlegroups.com>   <hPkEg.12700$j7.324766@news.indigo.ie>   <4kebv5Fbjid9U3@individual.net>   <ebvd6b$2q45$1@news2.ipartners.pl>   <1155833275.678725.297060@h48g2000cwc.googlegroups.com>   <44e73f70$0$10146$9b4e6d93@newsspool2.arcor-online.net>   <1156162332.681008.153540@m73g2000cwd.googlegroups.com>   <4l60udFecegU1@individual.net>   <1156512377.765813.77030@b28g2000cwb.googlegroups.com>   <I4FHg.13108$j7.326494@news.indigo.ie> <1156523477.644185.312570@i42g2000cwa.googlegroups.com>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=unknown-8bit
Content-Transfer-Encoding: quoted-printable
X-Trace: news.demon.co.uk 1156624219 21182 158.152.254.254 (26 Aug 2006 20:30:19 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 26 Aug 2006 20:30:19 +0000 (UTC)
X-Original-To: std-c++@mailman.ucar.edu
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.csse.unimelb.edu.au id k7QKUGFS021433
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-Priority: 3
X-Greylisting: NO DELAY (Relay+Sender autoqualified);
	processed by UCSD_GL-v2.1 on mailbox7.ucsd.edu;
	Sat, 26 August 2006 06:38:39 -0700 (PDT)
X-Orig-X-Trace: individual.net ThyZXmpAs/160TP/hrRJkwGGzz/9vpbRCk+MR/1eTSjKqKpkR8
X-RFC2646: Format=Flowed; Original
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-MSMail-Priority: Normal
X-Originating-IP: 130.133.1.2
X-Received: (from fjh@localhost)
	by mulga.csse.unimelb.edu.au (8.13.6+Sun/8.13.6/Submit) id k7QKUFaS021417;
	Sun, 27 Aug 2006 06:30:15 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Delivered-To: std-c++@mailman.ucar.edu
X-Spamscanner: mailbox7.ucsd.edu  (v1.6 Jul  6 2006 16:38:12, -1.4/5.0 3.1.3)
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-Newsgroups: comp.std.c++
X-MailScanner: PASSED (v1.2.8 75134 k7QDcbGb081427 mailbox7.ucsd.edu)
Xref: g2news2.google.com comp.std.c++:3538

<kuyper@wizard.net> schrieb im Newsbeitrag=20
news:1156523477.644185.312570@i42g2000cwa.googlegroups.com...
> Frederick Gotham wrote:
>> kanze posted:
>>
>> > According to =A78.5.1/7: "If there are fewer initializers in the
>> > list than there are members in the aggregate, then each member
>> > not explicitly initialized shall be default-initialized."  So
>> >     T arr[1] =3D {} ;
>> > is the equivalent of:
>> >     T arr[1] =3D { T() } ;
>> > which is the equivalent of:
>> >     T arr =3D T() ;
>>
>>
>> I don't think you're corrected there. Just because something is defaul=
t-
>> initialised, doesn't mean there's a copy-construction involved.
>
> That's correct, but it misses the point. Re-read his post. It isn't the
> default-initialization that determines this, it's the use of
> brace-enclosed initializer list - per 8.5/12, his citation of which
> you've cut out of your reply. You need an argument to justify ignoring
> 8.5/12. I haven't seen one.

The argument is that in the expression

T arr[1] =3D {};

there are fewer initializers in the list than there are members in the=20
aggregate. Therefore, each member not explicitly initialized shall be=20
default-initialized. And default initialization is not copy initializatio=
n.

What we are discussing here is whether in

T arr[1] =3D {};

the object is copy initialized with a temporary that is in turn default=20
initialized, such as in

T arr[1] =3D { T() };

or whether there is no temporary created, and the object that is default=20
initialized is 'arr[0]' rather than a temporary.

If we read 8.5.1/7 again, it says that "EACH MEMBER NOT EXPLICITLY=20
INITIALIZED shall be default-initialized". Now which is the member not=20
explicitly initialized? 'arr[0]' or the temporary (which I doubt exists a=
t=20
all)?

--=20
Matthias Hofmann
Anvil-Soft, CEO
http://www.anvil-soft.com - The Creators of Toilet Tycoon
http://www.anvil-soft.de - Die Macher des Klomanagers


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



