From -2907997534295386979
X-Google-Thread: f78e5,51456c3eb8f9490e
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII
Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 28 Aug 2006 10:20:05 -0500
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@mailman.ucar.edu
From: "Matthias Hofmann" <hofmann@anvil-soft.com>
Newsgroups: comp.std.c++
Subject: Re: Copy Constructor Confusion!
Message-ID: <4lg2ecF1o2flU1@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> <4lb16sF130luU1@individual.net> <ecrei5$1lo1$1@ns.felk.cvut.cz>
X-Orig-X-Trace: individual.net 2Qdft5KvG2HxSfN4ELFj5wxI0zn16OBS+ZZjkFUz4bSfCaYWoe
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-Originating-IP: 130.133.1.2
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Date: Mon, 28 Aug 2006 10:18:27 CST
Lines: 71
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-EPygvdGPf92/gOzRWbc/f9UY6Kh0LmxUaJJMpobpdWKhhJv+70nT2XBsT/p/bb+98rpc4xC0PbFQzgu!Fc/Fr6/oa/H3YPjc1t4w49s7yqZUXB6hvFe5kXdOtJA9tpsa9EUJeZPDoxpxxc5iBxps3kPtXmr/!nRXhvEZaBao=
X-Complaints-To: abuse@speakeasy.net
X-DMCA-Complaints-To: abuse@speakeasy.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Xref: g2news2.google.com comp.std.c++:3562

""Martin Vejn�r"" <avakar@volny.cz> schrieb im Newsbeitrag 
news:ecrei5$1lo1$1@ns.felk.cvut.cz...
> Matthias Hofmann wrote:
>> <kuyper@wizard.net> schrieb im Newsbeitrag 
>> news:1156523477.644185.312570@i42g2000cwa.googlegroups.com...
>> [...regarding aggregate initialization...]
>>
>> The argument is that in the expression
>>
>> T arr[1] = {};
>>
>> there are fewer initializers in the list than there are members in the 
>> aggregate. Therefore, each member not explicitly initialized shall be 
>> default-initialized. And default initialization is not copy 
>> initialization.
>>
>> What we are discussing here is whether in
>>
>> T arr[1] = {};
>>
>> the object is copy initialized with a temporary that is in turn default 
>> initialized, such as in
>>
>> T arr[1] = { T() };
>>
>> or whether there is no temporary created, and the object that is default 
>> initialized is 'arr[0]' rather than a temporary.
>>
>> If we read 8.5.1/7 again, it says that "EACH MEMBER NOT EXPLICITLY 
>> INITIALIZED shall be default-initialized". Now which is the member not 
>> explicitly initialized? 'arr[0]' or the temporary (which I doubt exists 
>> at all)?
>
> Is that written in the '03 standard?

No, its in the 98 standard. I do not have a copy of the 03 draft.

> The newest public draft says [8.5.1/7]: "If there are fewer initializers 
> in the list than there are members in the aggregate, then each memeber not 
> explicitly initialized shall be _value-initialized_ (8.5)".

I don't know what value-initialized means - does it involve copy 
construction?

> Also, it never uses the term "member of an initializer-list" (that would 
> be an "initializer"). It is a member of the aggregate that gets 
> value-initialized, and so the copy constructor is unnessesary.
>
> Comeau compiles the following code without errors (as it should).
>

[snipping code]

That's my point. The way I understand things, neither the new nor the old 
standard requires an accessible copy constructor in an expression such as

T arr[1] = {};

-- 
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                      ]



