From -4947790211054126226
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!news2.google.com!news.glorb.com!news-xfer.nntp.sonic.net!news.alt.net!frodo.cs.rpi.edu!not-for-mail
From: Faisal Vali <faisalv@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: Why is std::array an aggregate?
Date: Sun, 20 Dec 2009 22:00:47 CST
Organization: http://groups.google.com
Lines: 31
Sender: cppmods@cs.rpi.edu
Approved: james.dennett@gmail.com
Message-ID: <e4267a16-77ab-4f65-8f02-904e3e60f201@h9g2000yqa.googlegroups.com>
References: <hgf8r0$7ta$1@news.albasani.net>
 <2fba9f88-3e5e-472f-a2fa-b7b415f07f69@g26g2000yqe.googlegroups.com>
NNTP-Posting-Host: netlab.cs.rpi.edu
Content-Type: text/plain; charset=ISO-8859-1
To: (Usenet)
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
X-Original-Date: Sun, 20 Dec 2009 16:06:18 -0800 (PST)
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Xref: g2news1.google.com comp.std.c++:1949

On Dec 19, 12:55 am, James Kanze <james.ka...@gmail.com> wrote:
> On Dec 18, 9:00 pm, Scott Meyers <NeverR...@aristeia.com> wrote:
<snip>
>  (It still needs a
> mechanism for the number of elements to be determined,
> statically, from the initialization list, in order to be truly
> useful.)
>

I couldn't agree with you more - if only the following was allowed
with initializer lists, references to arrays, and aggregates:

template<class T, int N> std::array<T,N> array(const T (&arr)[N])
{
  return arr;
}

auto a = array({1,2,3,4});

regards,
Faisal Vali
Radiation Oncology
Loyola


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



