220 8796 <d57923b7-65ce-4f56-9122-94d68e675df8@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: jbates@jbat.es
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Fixed-sized alternative to initializer_list
Date: Fri, 24 Jan 2014 17:43:28 -0800 (PST)
Lines: 86
Approved: news@gmane.org
Message-ID: <d57923b7-65ce-4f56-9122-94d68e675df8@isocpp.org>
References: <320093b8-e08f-4918-9424-cd3d722a6652@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_781_28286138.1390614208202"
X-Trace: ger.gmane.org 1390614203 9470 80.91.229.3 (25 Jan 2014 01:43:23 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 25 Jan 2014 01:43:23 +0000 (UTC)
Cc: jbates@jbat.es
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD67TM4CW4KBBQNNRSLQKGQEULVEAII@isocpp.org Sat Jan 25 02:43:31 2014
Return-path: <std-proposals+bncBD67TM4CW4KBBQNNRSLQKGQEULVEAII@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f199.google.com ([209.85.223.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD67TM4CW4KBBQNNRSLQKGQEULVEAII@isocpp.org>)
	id 1W6sHT-00007l-32
	for gclcip-std-proposals@m.gmane.org; Sat, 25 Jan 2014 02:43:31 +0100
Original-Received: by mail-ie0-f199.google.com with SMTP id x13sf10755403ief.6
        for <gclcip-std-proposals@m.gmane.org>; Fri, 24 Jan 2014 17:43:30 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=pwA6NYWw4d7UoQpVkaEujBMcbw+GqewMnANQmjXapAY=;
        b=F/hIpq6p4/5b/PdjDPCe+MOWxNaAgYBtQonci+T6fJ/AcnPJdmesG6pJoGp2Zl/qK1
         lLRa0Ul0t7Af2XTEx1c7pPxAdj208sV5uh6T7+kpvk+b6S0NO3L/uUaTauRFwPF07PUv
         aINha1r027MAsJBwc+h/Mget3QHgx74RHVTej/Tt9nykFUl/9FSSa8bIxyImw7pOQ1pQ
         e4vPdQcv0kcKzhxbrWzxv+kUTEOvXYBwxBcizYUGAmO9SYoS9pCKgJEySmyI47fAwwPR
         82wWFB1iUagrEYgDV3C5TRwrBFxhO1zyM+oSwGXDXSbGg99L+XtYuXMpi6CE3q9LaF2U
         n3IA==
X-Gm-Message-State: ALoCoQkjk4zUVF15rCbMYpRUsxplOQsRgrYFFNGzPkQvKd473iCJ5fJtp87hipsRD0EOJ4o8ngjQ
X-Received: by 10.182.158.4 with SMTP id wq4mr6579308obb.18.1390614210132;
        Fri, 24 Jan 2014 17:43:30 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.41.2 with SMTP id b2ls1185777igl.26.canary; Fri, 24 Jan
 2014 17:43:29 -0800 (PST)
X-Received: by 10.50.20.7 with SMTP id j7mr67826ige.8.1390614209552;
        Fri, 24 Jan 2014 17:43:29 -0800 (PST)
In-Reply-To: <320093b8-e08f-4918-9424-cd3d722a6652@isocpp.org>
X-Original-Sender: jbates@jbat.es
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:8796
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8796>

------=_Part_781_28286138.1390614208202
Content-Type: text/plain; charset=UTF-8

Just realized I didn't really give any details for what I want to propose!

What I want would be essentially the same as initializer_list, but have a 
second template parameter specifying a size. It would then only match 
braced-init-lists of the specified size. Maybe it would also match the 
interface of std::array and/or include some easy way to initialize 
std::arrays or C-style arrays with it.

On Friday, January 24, 2014 3:36:40 PM UTC-10, jba...@jbat.es wrote:
>
> I've been playing around with types that extend the functionality of 
> std::array. I want to add more constructors, but I also want to retain the 
> aggregate initialization syntax, e.g.:
> my_cool_array_type<float, 4> a = {1, 2, 3, 4};
>
> Neither variadic templates nor initializer_list yield satisfactory 
> results. A good discussion as to why can be found in the following SO 
> question: 
> http://stackoverflow.com/questions/21342545/implementing-stdarray-like-constructors-in-other-classes
>
> initializer_list comes close, but it's not well-optimized for generic 
> fixed-sized containers. Is anyone opposed to a fixed-sized alternative to 
> initializer_list (maybe call it initializer_array)? I'm interested in 
> writing a proposal.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_781_28286138.1390614208202
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Just realized I didn't really give any details for what I =
want to propose!<br><br>What I want would be essentially the same as initia=
lizer_list, but have a second template parameter specifying a size. It woul=
d then only match braced-init-lists of the specified size. Maybe it would a=
lso match the interface of std::array and/or include some easy way to initi=
alize std::arrays or C-style arrays with it.<br><br>On Friday, January 24, =
2014 3:36:40 PM UTC-10, jba...@jbat.es wrote:<blockquote class=3D"gmail_quo=
te" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddi=
ng-left: 1ex;"><div dir=3D"ltr">I've been playing around with types that ex=
tend the functionality of std::array. I want to add more constructors, but =
I also want to retain the aggregate initialization syntax, e.g.:<div>my_coo=
l_array_type&lt;float, 4&gt; a =3D {1, 2, 3, 4};</div><div><br></div><div>N=
either variadic templates nor initializer_list yield satisfactory results. =
A good discussion as to why can be found in the following SO question:&nbsp=
;<a href=3D"http://stackoverflow.com/questions/21342545/implementing-stdarr=
ay-like-constructors-in-other-classes" target=3D"_blank" onmousedown=3D"thi=
s.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fstackoverflow.com%2Fqu=
estions%2F21342545%2Fimplementing-stdarray-like-constructors-in-other-class=
es\46sa\75D\46sntz\0751\46usg\75AFQjCNG4WYZNzlZEMWF8sLon3MEiUt_5Rw';return =
true;" onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fs=
tackoverflow.com%2Fquestions%2F21342545%2Fimplementing-stdarray-like-constr=
uctors-in-other-classes\46sa\75D\46sntz\0751\46usg\75AFQjCNG4WYZNzlZEMWF8sL=
on3MEiUt_5Rw';return true;">http://<wbr>stackoverflow.com/questions/<wbr>21=
342545/implementing-<wbr>stdarray-like-constructors-in-<wbr>other-classes</=
a></div><div><br></div><div>initializer_list comes close, but it's not well=
-optimized for generic fixed-sized containers. Is anyone opposed to a fixed=
-sized alternative to initializer_list (maybe call it initializer_array)? I=
'm interested in writing a proposal.</div></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_781_28286138.1390614208202--

.
