From -1139726113765348045
X-Google-Thread: 7894ca11fe,8390690191732735
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 21 Dec 2009 12:10:01 -0600
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
To: (Usenet)
From: "Balog Pal" <pasa@lib.hu>
Newsgroups: comp.std.c++
Subject: Re: Why is std::array an aggregate?
Organization: ETT newsserver
Sender: cppmods@cs.rpi.edu
Approved: stephen.clamage@sun.com
Message-ID: <hgnuka$1p0$1@news.ett.com.ua>
References: <hgf8r0$7ta$1@news.albasani.net>
  <2fba9f88-3e5e-472f-a2fa-b7b415f07f69@g26g2000yqe.googlegroups.com>
  <hgiv5f$cca$1@news.albasani.net>
  <c93ad741-55bf-4ff2-8893-29261e44097d@l13g2000yqb.googlegroups.com>
  <hgmhf2$vuc$1@news.albasani.net>
Content-Type: text/plain;
	format=flowed;
	charset="windows-1252";
	reply-type=response
X-Original-Date: Mon, 21 Dec 2009 14:56:50 +0100
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Date: Mon, 21 Dec 2009 12:00:53 CST
Lines: 33
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-PErbDNyxOY+N/WSmQLcRgQjDBEA5KBG0q3Jf8WWMkU+4CGD/dr5XriDwYy0ZHCM38Vcad1hVjDtGwi2!nsLMPkUAt2mCiJu8NnCevj+4XiYRsPd1uZ7XDdgSUEbYwJuGO6wmxg==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
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.40
Xref: g2news1.google.com comp.std.c++:1952

"Scott Meyers" <NeverRead@aristeia.com>

>> Regardless of where this definition appears, I'm guaranteed that
>> it occurs before *any* user defined code, including code in
>> constructors of other static objects.  In certain cases, that's
>> a useful guarantee.
>
> Is this really true?  What about the following at namespace scope?
>
> std::array<int, 3> a = { f(), g(), h() };
> std::array<int, 3> b = { 1, 2, 3 };
>
>> - if an object with static or thread storage duration is initialized such
>>  that the initialization satisfies the requirements for the object being
>>  declared with constexpr (7.1.5).
>>
> In the code I showed, b isn't a reference, so the first bullet doesn't
> apply.  b isn't declared constexpr either, so it's not clear to me
> that the second bullet applies, either, although the wording is rather
> odd.

It shall apply. With a fast scan I couldn't locate where it says that
literals count as constexpr, but 7.1.5 p7 has a matching example that
implies.



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



