Topic: Fixed-sized alternative to initializer_list


Author: jbates@jbat.es
Date: Fri, 24 Jan 2014 17:36:40 -0800 (PST)
Raw View
------=_Part_1065_2565501.1390613800858
Content-Type: text/plain; charset=UTF-8

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_1065_2565501.1390613800858
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I've been playing around with types that extend the functi=
onality of std::array. I want to add more constructors, but I also want to =
retain the aggregate initialization syntax, e.g.:<div>my_cool_array_type&lt=
;float, 4&gt; a =3D {1, 2, 3, 4};</div><div><br></div><div>Neither variadic=
 templates nor initializer_list yield satisfactory results. A good discussi=
on as to why can be found in the following SO question:&nbsp;<a href=3D"htt=
p://stackoverflow.com/questions/21342545/implementing-stdarray-like-constru=
ctors-in-other-classes">http://stackoverflow.com/questions/21342545/impleme=
nting-stdarray-like-constructors-in-other-classes</a></div><div><br></div><=
div>initializer_list comes close, but it's not well-optimized for generic f=
ixed-sized containers. Is anyone opposed to a fixed-sized alternative to in=
itializer_list (maybe call it initializer_array)? I'm interested in writing=
 a proposal.</div></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_1065_2565501.1390613800858--

.


Author: jbates@jbat.es
Date: Fri, 24 Jan 2014 17:43:28 -0800 (PST)
Raw View
------=_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--

.


Author: Alex B <devalexb@gmail.com>
Date: Sat, 25 Jan 2014 11:45:57 -0800 (PST)
Raw View
------=_Part_148_11429398.1390679157882
Content-Type: text/plain; charset=UTF-8

I just posted on SO a solution that should do the trick in C++11.

The cleanest solution would probably to have fixed size parameter packs:
https://groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/WsZsqdI2kJc

Unfortunately, there does not seem to be a proposal in sight for what is
suggested in the original post of the linked thread.

Another solution to this problem might be the ability to generate packs "on
the fly" with a packification operator or pack aliases which were discussed
in the two following threads:
https://groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/g1HziHt1lbo
https://groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/YkHPCYb-KPQ

I don't have any proposal planned about this for the moment and I don't
know if Richard has plans concerning this.


On Friday, January 24, 2014 8:43:28 PM UTC-5, jba...@jbat.es wrote:

> 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_148_11429398.1390679157882
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I just posted on SO a solution that should do the tri=
ck in C++11.</div><div><br></div><div>The cleanest solution would probably =
to have fixed size parameter packs:</div><div><a href=3D"https://groups.goo=
gle.com/a/isocpp.org/forum/#!starred/std-proposals/WsZsqdI2kJc">https://gro=
ups.google.com/a/isocpp.org/forum/#!starred/std-proposals/WsZsqdI2kJc</a></=
div><div><br></div><div>Unfortunately, there&nbsp;does not seem to be a pro=
posal in sight for what is suggested in the original post of the linked thr=
ead.</div><div><br></div><div>Another solution to this problem might be the=
 ability to generate packs "on the fly" with a packification operator&nbsp;=
or pack aliases which were discussed in the two following threads:</div><di=
v><a href=3D"https://groups.google.com/a/isocpp.org/forum/#!starred/std-pro=
posals/g1HziHt1lbo">https://groups.google.com/a/isocpp.org/forum/#!starred/=
std-proposals/g1HziHt1lbo</a></div><div><a href=3D"https://groups.google.co=
m/a/isocpp.org/forum/#!starred/std-proposals/YkHPCYb-KPQ">https://groups.go=
ogle.com/a/isocpp.org/forum/#!starred/std-proposals/YkHPCYb-KPQ</a></div><d=
iv><br></div><div>I don't have any proposal planned about this for the mome=
nt and I don't know if Richard has plans concerning this.</div><div><br><br=
>On Friday, January 24, 2014 8:43:28 PM UTC-5, jba...@jbat.es wrote:</div><=
blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; paddin=
g-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px;=
 border-left-style: solid;"><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 es=
sentially the same as initializer_list, but have a second template paramete=
r specifying a size. It would then only match braced-init-lists of the spec=
ified size. Maybe it would also match the interface of std::array and/or in=
clude some easy way to initialize std::arrays or C-style arrays with it.<br=
><br>On Friday, January 24, 2014 3:36:40 PM UTC-10, <a>jba...@jbat.es</a> w=
rote:<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; =
padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width=
: 1px; border-left-style: solid;"><div dir=3D"ltr">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 synta=
x, e.g.:<div>my_cool_array_type&lt;float, 4&gt; a =3D {1, 2, 3, 4};</div><d=
iv><br></div><div>Neither variadic templates nor initializer_list yield sat=
isfactory results. A good discussion as to why can be found in the followin=
g SO question:&nbsp;<a onmousedown=3D"this.href=3D'http://www.google.com/ur=
l?q\75http%3A%2F%2Fstackoverflow.com%2Fquestions%2F21342545%2Fimplementing-=
stdarray-like-constructors-in-other-classes\46sa\75D\46sntz\0751\46usg\75AF=
QjCNG4WYZNzlZEMWF8sLon3MEiUt_5Rw';return true;" onclick=3D"this.href=3D'htt=
p://www.google.com/url?q\75http%3A%2F%2Fstackoverflow.com%2Fquestions%2F213=
42545%2Fimplementing-stdarray-like-constructors-in-other-classes\46sa\75D\4=
6sntz\0751\46usg\75AFQjCNG4WYZNzlZEMWF8sLon3MEiUt_5Rw';return true;" href=
=3D"http://stackoverflow.com/questions/21342545/implementing-stdarray-like-=
constructors-in-other-classes" target=3D"_blank">http://<wbr>stackoverflow.=
com/questions/<wbr>21342545/implementing-<wbr>stdarray-like-constructors-in=
-<wbr>other-classes</a></div><div><br></div><div>initializer_list comes clo=
se, but it's not well-optimized for generic fixed-sized containers. Is anyo=
ne opposed to a fixed-sized alternative to initializer_list (maybe call it =
initializer_array)? I'm interested in writing a proposal.</div></div></bloc=
kquote></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_148_11429398.1390679157882--

.


Author: jbates@jbat.es
Date: Sat, 25 Jan 2014 14:12:46 -0800 (PST)
Raw View
------=_Part_1594_31323664.1390687966619
Content-Type: text/plain; charset=UTF-8

Those fixed size parameter packs look like they would solve my problem
perfectly, but I can't help but wonder why initializer_list was implemented
as a type instead of a new syntax. Anyone know the reasoning behind that? I
imagine whatever it is, it applies here too.

On Saturday, January 25, 2014 9:45:57 AM UTC-10, Alex B wrote:
>
> I just posted on SO a solution that should do the trick in C++11.
>
> The cleanest solution would probably to have fixed size parameter packs:
>
> https://groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/WsZsqdI2kJc
>
> Unfortunately, there does not seem to be a proposal in sight for what is
> suggested in the original post of the linked thread.
>
> Another solution to this problem might be the ability to generate packs
> "on the fly" with a packification operator or pack aliases which were
> discussed in the two following threads:
>
> https://groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/g1HziHt1lbo
>
> https://groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/YkHPCYb-KPQ
>
> I don't have any proposal planned about this for the moment and I don't
> know if Richard has plans concerning this.
>
>
> On Friday, January 24, 2014 8:43:28 PM UTC-5, jba...@jbat.es wrote:
>
>> 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_1594_31323664.1390687966619
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Those fixed size parameter packs look like they would solv=
e my problem perfectly, but I can't help but wonder why initializer_list wa=
s implemented as a type instead of a new syntax. Anyone know the reasoning =
behind that? I imagine whatever it is, it applies here too.<br><br>On Satur=
day, January 25, 2014 9:45:57 AM UTC-10, Alex B wrote:<blockquote class=3D"=
gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc so=
lid;padding-left: 1ex;"><div dir=3D"ltr"><div>I just posted on SO a solutio=
n that should do the trick in C++11.</div><div><br></div><div>The cleanest =
solution would probably to have fixed size parameter packs:</div><div><a hr=
ef=3D"https://groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/=
WsZsqdI2kJc" target=3D"_blank" onmousedown=3D"this.href=3D'https://groups.g=
oogle.com/a/isocpp.org/forum/#!starred/std-proposals/WsZsqdI2kJc';return tr=
ue;" onclick=3D"this.href=3D'https://groups.google.com/a/isocpp.org/forum/#=
!starred/std-proposals/WsZsqdI2kJc';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/forum/#!starred/<wbr>std-proposals/WsZsqdI2kJc</a></div>=
<div><br></div><div>Unfortunately, there&nbsp;does not seem to be a proposa=
l in sight for what is suggested in the original post of the linked thread.=
</div><div><br></div><div>Another solution to this problem might be the abi=
lity to generate packs "on the fly" with a packification operator&nbsp;or p=
ack aliases which were discussed in the two following threads:</div><div><a=
 href=3D"https://groups.google.com/a/isocpp.org/forum/#!starred/std-proposa=
ls/g1HziHt1lbo" target=3D"_blank" onmousedown=3D"this.href=3D'https://group=
s.google.com/a/isocpp.org/forum/#!starred/std-proposals/g1HziHt1lbo';return=
 true;" onclick=3D"this.href=3D'https://groups.google.com/a/isocpp.org/foru=
m/#!starred/std-proposals/g1HziHt1lbo';return true;">https://groups.google.=
com/a/<wbr>isocpp.org/forum/#!starred/<wbr>std-proposals/g1HziHt1lbo</a></d=
iv><div><a href=3D"https://groups.google.com/a/isocpp.org/forum/#!starred/s=
td-proposals/YkHPCYb-KPQ" target=3D"_blank" onmousedown=3D"this.href=3D'htt=
ps://groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/YkHPCYb-K=
PQ';return true;" onclick=3D"this.href=3D'https://groups.google.com/a/isocp=
p.org/forum/#!starred/std-proposals/YkHPCYb-KPQ';return true;">https://grou=
ps.google.com/a/<wbr>isocpp.org/forum/#!starred/<wbr>std-proposals/YkHPCYb-=
KPQ</a></div><div><br></div><div>I don't have any proposal planned about th=
is for the moment and I don't know if Richard has plans concerning this.</d=
iv><div><br><br>On Friday, January 24, 2014 8:43:28 PM UTC-5, <a>jba...@jba=
t.es</a> wrote:</div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-le=
ft-width:1px;border-left-style:solid"><div dir=3D"ltr">Just realized I didn=
't really give any details for what I want to propose!<br><br>What I want w=
ould be essentially the same as initializer_list, but have a second templat=
e parameter specifying a size. It would then only match braced-init-lists o=
f 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 w=
ith it.<br><br>On Friday, January 24, 2014 3:36:40 PM UTC-10, <a>jba...@jba=
t.es</a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0p=
x 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-wid=
th:1px;border-left-style:solid"><div dir=3D"ltr">I've been playing around w=
ith types that extend the functionality of std::array. I want to add more c=
onstructors, but I also want to retain the aggregate initialization syntax,=
 e.g.:<div>my_cool_array_type&lt;float, 4&gt; a =3D {1, 2, 3, 4};</div><div=
><br></div><div>Neither variadic templates nor initializer_list yield satis=
factory results. A good discussion as to why can be found in the following =
SO question:&nbsp;<a href=3D"http://stackoverflow.com/questions/21342545/im=
plementing-stdarray-like-constructors-in-other-classes" target=3D"_blank" o=
nmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fstack=
overflow.com%2Fquestions%2F21342545%2Fimplementing-stdarray-like-constructo=
rs-in-other-classes\46sa\75D\46sntz\0751\46usg\75AFQjCNG4WYZNzlZEMWF8sLon3M=
EiUt_5Rw';return true;" onclick=3D"this.href=3D'http://www.google.com/url?q=
\75http%3A%2F%2Fstackoverflow.com%2Fquestions%2F21342545%2Fimplementing-std=
array-like-constructors-in-other-classes\46sa\75D\46sntz\0751\46usg\75AFQjC=
NG4WYZNzlZEMWF8sLon3MEiUt_5Rw';return true;">http://<wbr>stackoverflow.com/=
questions/<wbr>21342545/implementing-<wbr>stdarray-like-constructors-in-<wb=
r>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 o=
pposed to a fixed-sized alternative to initializer_list (maybe call it init=
ializer_array)? I'm interested in writing a proposal.</div></div></blockquo=
te></div></blockquote></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_1594_31323664.1390687966619--

.


Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Sat, 25 Jan 2014 14:25:13 -0800
Raw View
--001a11c306f02e40b004f0d2f533
Content-Type: text/plain; charset=UTF-8

I'm confused why you need initializer list for this. If you want a fixed
number of parameters, isn't any old POD struct just fine for what you're
trying to accomplish?

For instance:

http://ideone.com/mjG3u1

struct foo { int a, b, c; };
void i_only_take_three_braced_parameters(foo f)
{
    // ...
}
int main()
{
    i_only_take_three_braced_parameters({1, 2, 3});
    i_only_take_three_braced_parameters({1, 2, 3, 4});
}

What is the overall issue you're trying to solve by limiting the number of
initializers?


Billy O'Neal
https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
http://stackoverflow.com/users/82320/billy-oneal


On Sat, Jan 25, 2014 at 2:12 PM, <jbates@jbat.es> wrote:

> Those fixed size parameter packs look like they would solve my problem
> perfectly, but I can't help but wonder why initializer_list was implemented
> as a type instead of a new syntax. Anyone know the reasoning behind that? I
> imagine whatever it is, it applies here too.
>
> On Saturday, January 25, 2014 9:45:57 AM UTC-10, Alex B wrote:
>>
>> I just posted on SO a solution that should do the trick in C++11.
>>
>> The cleanest solution would probably to have fixed size parameter packs:
>> https://groups.google.com/a/isocpp.org/forum/#!starred/
>> std-proposals/WsZsqdI2kJc
>>
>> Unfortunately, there does not seem to be a proposal in sight for what is
>> suggested in the original post of the linked thread.
>>
>> Another solution to this problem might be the ability to generate packs
>> "on the fly" with a packification operator or pack aliases which were
>> discussed in the two following threads:
>> https://groups.google.com/a/isocpp.org/forum/#!starred/
>> std-proposals/g1HziHt1lbo
>> https://groups.google.com/a/isocpp.org/forum/#!starred/
>> std-proposals/YkHPCYb-KPQ
>>
>> I don't have any proposal planned about this for the moment and I don't
>> know if Richard has plans concerning this.
>>
>>
>> On Friday, January 24, 2014 8:43:28 PM UTC-5, jba...@jbat.es wrote:
>>
>>> 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/.
>

--

---
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/.

--001a11c306f02e40b004f0d2f533
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I&#39;m confused why you need initializer list for th=
is. If you want a fixed number of parameters, isn&#39;t any old POD struct =
just fine for what you&#39;re trying to accomplish?</div><div><br></div><di=
v>

For instance:</div><div><br></div><div><a href=3D"http://ideone.com/mjG3u1"=
>http://ideone.com/mjG3u1</a></div><div><br></div><div>struct foo { int a, =
b, c; };</div><div>void i_only_take_three_braced_parameters(foo f)<br>{<br>

=C2=A0=C2=A0=C2=A0 // ...<br>}</div><div>int main()<br>{<br>=C2=A0=C2=A0=C2=
=A0 i_only_take_three_braced_parameters({1, 2, 3});<br>=C2=A0=C2=A0=C2=A0 i=
_only_take_three_braced_parameters({1, 2, 3, 4});<br>}</div><div><br></div>=
<div>What is the overall issue you&#39;re trying to solve by limiting the n=
umber of initializers?<br>

</div><div><br></div></div><div class=3D"gmail_extra"><br clear=3D"all"><di=
v><div dir=3D"ltr"><div>Billy O&#39;Neal</div><div><a href=3D"https://bitbu=
cket.org/BillyONeal/" target=3D"_blank">https://github.com/BillyONeal/</a><=
/div>
<div>
<a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=3D"_bla=
nk">http://stackoverflow.com/users/82320/billy-oneal</a></div></div></div>
<br><br><div class=3D"gmail_quote">On Sat, Jan 25, 2014 at 2:12 PM,  <span =
dir=3D"ltr">&lt;<a href=3D"mailto:jbates@jbat.es" target=3D"_blank">jbates@=
jbat.es</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir=3D"ltr">Those fixed size parameter packs look like they would solv=
e my problem perfectly, but I can&#39;t help but wonder why initializer_lis=
t was implemented as a type instead of a new syntax. Anyone know the reason=
ing behind that? I imagine whatever it is, it applies here too.<br>

<br>On Saturday, January 25, 2014 9:45:57 AM UTC-10, Alex B wrote:<blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex=
;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style=
:solid">

<div dir=3D"ltr"><div>I just posted on SO a solution that should do the tri=
ck in C++11.</div><div><br></div><div>The cleanest solution would probably =
to have fixed size parameter packs:</div><div><a href=3D"https://groups.goo=
gle.com/a/isocpp.org/forum/#!starred/std-proposals/WsZsqdI2kJc" target=3D"_=
blank">https://groups.google.com/a/<u></u>isocpp.org/forum/#!starred/<u></u=
>std-proposals/WsZsqdI2kJc</a></div>

<div><br></div><div>Unfortunately, there=C2=A0does not seem to be a proposa=
l in sight for what is suggested in the original post of the linked thread.=
</div><div><br></div><div>Another solution to this problem might be the abi=
lity to generate packs &quot;on the fly&quot; with a packification operator=
=C2=A0or pack aliases which were discussed in the two following threads:</d=
iv>

<div><a href=3D"https://groups.google.com/a/isocpp.org/forum/#!starred/std-=
proposals/g1HziHt1lbo" target=3D"_blank">https://groups.google.com/a/<u></u=
>isocpp.org/forum/#!starred/<u></u>std-proposals/g1HziHt1lbo</a></div><div>

<a href=3D"https://groups.google.com/a/isocpp.org/forum/#!starred/std-propo=
sals/YkHPCYb-KPQ" target=3D"_blank">https://groups.google.com/a/<u></u>isoc=
pp.org/forum/#!starred/<u></u>std-proposals/YkHPCYb-KPQ</a></div><div><br>
</div>
<div>I don&#39;t have any proposal planned about this for the moment and I =
don&#39;t know if Richard has plans concerning this.</div><div><div class=
=3D"h5"><div><br><br>On Friday, January 24, 2014 8:43:28 PM UTC-5, <a>jba..=
..@jbat.es</a> wrote:</div>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding=
-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-l=
eft-style:solid"><div dir=3D"ltr">Just realized I didn&#39;t really give an=
y details for what I want to propose!<br>

<br>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 br=
aced-init-lists of the specified size. Maybe it would also match the interf=
ace of std::array and/or include some easy way to initialize std::arrays or=
 C-style arrays with it.<br>

<br>On Friday, January 24, 2014 3:36:40 PM UTC-10, <a>jba...@jbat.es</a> wr=
ote:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;pad=
ding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;bord=
er-left-style:solid">

<div dir=3D"ltr">I&#39;ve been playing around with types that extend the fu=
nctionality of std::array. I want to add more constructors, but I also want=
 to retain the aggregate initialization syntax, e.g.:<div>my_cool_array_typ=
e&lt;float, 4&gt; a =3D {1, 2, 3, 4};</div>

<div><br></div><div>Neither variadic templates nor initializer_list yield s=
atisfactory results. A good discussion as to why can be found in the follow=
ing SO question:=C2=A0<a href=3D"http://stackoverflow.com/questions/2134254=
5/implementing-stdarray-like-constructors-in-other-classes" target=3D"_blan=
k">http://<u></u>stackoverflow.com/questions/<u></u>21342545/implementing-<=
u></u>stdarray-like-constructors-in-<u></u>other-classes</a></div>

<div><br></div><div>initializer_list comes close, but it&#39;s not well-opt=
imized for generic fixed-sized containers. Is anyone opposed to a fixed-siz=
ed alternative to initializer_list (maybe call it initializer_array)? I&#39=
;m interested in writing a proposal.</div>

</div></blockquote></div></blockquote></div></div></div></blockquote></div>=
<div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
=C2=A0<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 <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></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 />

--001a11c306f02e40b004f0d2f533--

.


Author: jbates@jbat.es
Date: Sun, 26 Jan 2014 18:28:20 -0800 (PST)
Raw View
------=_Part_4_4128052.1390789700976
Content-Type: text/plain; charset=UTF-8

I'm mostly interested in mimicking the syntax for aggregate initialization
for array types on custom types. Again, I want to be able to write
something like the following:

my_cool_array_type<float, 4> a = {1, 2, 3, 4};

I'm aware it's easy to do with other syntax, but I really like the above
syntax. Also, with PODs like the one you suggest, it's possible to give
less than enough values, e.g:

i_only_take_three_braced_parameters({1, 2});

would be accepted whereas what I'm proposing would allow exactly 3 values;
no more or less.

On Saturday, January 25, 2014 12:25:13 PM UTC-10, Billy O'Neal wrote:
>
> I'm confused why you need initializer list for this. If you want a fixed
> number of parameters, isn't any old POD struct just fine for what you're
> trying to accomplish?
>
> For instance:
>
> http://ideone.com/mjG3u1
>
> struct foo { int a, b, c; };
> void i_only_take_three_braced_parameters(foo f)
> {
>     // ...
> }
> int main()
> {
>     i_only_take_three_braced_parameters({1, 2, 3});
>     i_only_take_three_braced_parameters({1, 2, 3, 4});
> }
>
> What is the overall issue you're trying to solve by limiting the number of
> initializers?
>
>
> Billy O'Neal
> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>  http://stackoverflow.com/users/82320/billy-oneal
>
>
> On Sat, Jan 25, 2014 at 2:12 PM, <jba...@jbat.es <javascript:>> wrote:
>
>> Those fixed size parameter packs look like they would solve my problem
>> perfectly, but I can't help but wonder why initializer_list was implemented
>> as a type instead of a new syntax. Anyone know the reasoning behind that? I
>> imagine whatever it is, it applies here too.
>>
>> On Saturday, January 25, 2014 9:45:57 AM UTC-10, Alex B wrote:
>>>
>>> I just posted on SO a solution that should do the trick in C++11.
>>>
>>> The cleanest solution would probably to have fixed size parameter packs:
>>> https://groups.google.com/a/isocpp.org/forum/#!starred/
>>> std-proposals/WsZsqdI2kJc
>>>
>>> Unfortunately, there does not seem to be a proposal in sight for what is
>>> suggested in the original post of the linked thread.
>>>
>>> Another solution to this problem might be the ability to generate packs
>>> "on the fly" with a packification operator or pack aliases which were
>>> discussed in the two following threads:
>>> https://groups.google.com/a/isocpp.org/forum/#!starred/
>>> std-proposals/g1HziHt1lbo
>>> https://groups.google.com/a/isocpp.org/forum/#!starred/
>>> std-proposals/YkHPCYb-KPQ
>>>
>>>  I don't have any proposal planned about this for the moment and I
>>> don't know if Richard has plans concerning this.
>>>
>>>
>>> On Friday, January 24, 2014 8:43:28 PM UTC-5, jba...@jbat.es wrote:
>>>
>>>> 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-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> Visit this group at
>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>
>
>

--

---
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_4_4128052.1390789700976
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I'm mostly interested in mimicking the syntax for aggregat=
e initialization for array types on custom types. Again, I want to be able =
to write something like the following:<div><br></div><div>my_cool_array_typ=
e&lt;float, 4&gt; a =3D {1, 2, 3, 4};</div><div><br></div><div>I'm aware it=
's easy to do with other syntax, but I really like the above syntax. Also, =
with PODs like the one you suggest, it's possible to give less than enough =
values, e.g:</div><div><br></div><div>i_only_take_three_braced_<wbr>paramet=
ers({1, 2});<br></div><div><br></div><div>would be accepted whereas what I'=
m proposing would allow exactly 3 values; no more or less.</div><div><br>On=
 Saturday, January 25, 2014 12:25:13 PM UTC-10, Billy O'Neal wrote:<blockqu=
ote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left=
: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>I'm confused why=
 you need initializer list for this. If you want a fixed number of paramete=
rs, isn't any old POD struct just fine for what you're trying to accomplish=
?</div><div><br></div><div>

For instance:</div><div><br></div><div><a href=3D"http://ideone.com/mjG3u1"=
 target=3D"_blank" onmousedown=3D"this.href=3D'http://www.google.com/url?q\=
75http%3A%2F%2Fideone.com%2FmjG3u1\46sa\75D\46sntz\0751\46usg\75AFQjCNF0cNy=
HiypcqM2d9b1IGPCgxWM1AA';return true;" onclick=3D"this.href=3D'http://www.g=
oogle.com/url?q\75http%3A%2F%2Fideone.com%2FmjG3u1\46sa\75D\46sntz\0751\46u=
sg\75AFQjCNF0cNyHiypcqM2d9b1IGPCgxWM1AA';return true;">http://ideone.com/mj=
G3u1</a></div><div><br></div><div>struct foo { int a, b, c; };</div><div>vo=
id i_only_take_three_braced_<wbr>parameters(foo f)<br>{<br>

&nbsp;&nbsp;&nbsp; // ...<br>}</div><div>int main()<br>{<br>&nbsp;&nbsp;&nb=
sp; i_only_take_three_braced_<wbr>parameters({1, 2, 3});<br>&nbsp;&nbsp;&nb=
sp; i_only_take_three_braced_<wbr>parameters({1, 2, 3, 4});<br>}</div><div>=
<br></div><div>What is the overall issue you're trying to solve by limiting=
 the number of initializers?<br>

</div><div><br></div></div><div><br clear=3D"all"><div><div dir=3D"ltr"><di=
v>Billy O'Neal</div><div><a href=3D"https://bitbucket.org/BillyONeal/" targ=
et=3D"_blank" onmousedown=3D"this.href=3D'https://www.google.com/url?q\75ht=
tps%3A%2F%2Fbitbucket.org%2FBillyONeal%2F\46sa\75D\46sntz\0751\46usg\75AFQj=
CNEUaaIry0cea0l0vX6ztWgwQ7_4Lg';return true;" onclick=3D"this.href=3D'https=
://www.google.com/url?q\75https%3A%2F%2Fbitbucket.org%2FBillyONeal%2F\46sa\=
75D\46sntz\0751\46usg\75AFQjCNEUaaIry0cea0l0vX6ztWgwQ7_4Lg';return true;">h=
ttps://github.com/BillyONeal/</a></div>
<div>
<a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=3D"_bla=
nk" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2F=
stackoverflow.com%2Fusers%2F82320%2Fbilly-oneal\46sa\75D\46sntz\0751\46usg\=
75AFQjCNHY_gA133vyg0yY-U2PNMVA8cCSBg';return true;" onclick=3D"this.href=3D=
'http://www.google.com/url?q\75http%3A%2F%2Fstackoverflow.com%2Fusers%2F823=
20%2Fbilly-oneal\46sa\75D\46sntz\0751\46usg\75AFQjCNHY_gA133vyg0yY-U2PNMVA8=
cCSBg';return true;">http://stackoverflow.com/<wbr>users/82320/billy-oneal<=
/a></div></div></div>
<br><br><div class=3D"gmail_quote">On Sat, Jan 25, 2014 at 2:12 PM,  <span =
dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-ma=
ilto=3D"HtONn1zgS6wJ" onmousedown=3D"this.href=3D'javascript:';return true;=
" onclick=3D"this.href=3D'javascript:';return true;">jba...@jbat.es</a>&gt;=
</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .=
8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir=3D"ltr">Those fixed size parameter packs look like they would solv=
e my problem perfectly, but I can't help but wonder why initializer_list wa=
s implemented as a type instead of a new syntax. Anyone know the reasoning =
behind that? I imagine whatever it is, it applies here too.<br>

<br>On Saturday, January 25, 2014 9:45:57 AM UTC-10, Alex B wrote:<blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex=
;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style=
:solid">

<div dir=3D"ltr"><div>I just posted on SO a solution that should do the tri=
ck in C++11.</div><div><br></div><div>The cleanest solution would probably =
to have fixed size parameter packs:</div><div><a href=3D"https://groups.goo=
gle.com/a/isocpp.org/forum/#!starred/std-proposals/WsZsqdI2kJc" target=3D"_=
blank" onmousedown=3D"this.href=3D'https://groups.google.com/a/isocpp.org/f=
orum/#!starred/std-proposals/WsZsqdI2kJc';return true;" onclick=3D"this.hre=
f=3D'https://groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/W=
sZsqdI2kJc';return true;">https://groups.google.com/a/<u></u>is<wbr>ocpp.or=
g/forum/#!starred/<u></u>std-<wbr>proposals/WsZsqdI2kJc</a></div>

<div><br></div><div>Unfortunately, there&nbsp;does not seem to be a proposa=
l in sight for what is suggested in the original post of the linked thread.=
</div><div><br></div><div>Another solution to this problem might be the abi=
lity to generate packs "on the fly" with a packification operator&nbsp;or p=
ack aliases which were discussed in the two following threads:</div>

<div><a href=3D"https://groups.google.com/a/isocpp.org/forum/#!starred/std-=
proposals/g1HziHt1lbo" target=3D"_blank" onmousedown=3D"this.href=3D'https:=
//groups.google.com/a/isocpp.org/forum/#!starred/std-proposals/g1HziHt1lbo'=
;return true;" onclick=3D"this.href=3D'https://groups.google.com/a/isocpp.o=
rg/forum/#!starred/std-proposals/g1HziHt1lbo';return true;">https://groups.=
google.com/a/<u></u>is<wbr>ocpp.org/forum/#!starred/<u></u>std-<wbr>proposa=
ls/g1HziHt1lbo</a></div><div>

<a href=3D"https://groups.google.com/a/isocpp.org/forum/#!starred/std-propo=
sals/YkHPCYb-KPQ" target=3D"_blank" onmousedown=3D"this.href=3D'https://gro=
ups.google.com/a/isocpp.org/forum/#!starred/std-proposals/YkHPCYb-KPQ';retu=
rn true;" onclick=3D"this.href=3D'https://groups.google.com/a/isocpp.org/fo=
rum/#!starred/std-proposals/YkHPCYb-KPQ';return true;">https://groups.googl=
e.com/a/<u></u>is<wbr>ocpp.org/forum/#!starred/<u></u>std-<wbr>proposals/Yk=
HPCYb-KPQ</a></div><div><br>
</div>
<div>I don't have any proposal planned about this for the moment and I don'=
t know if Richard has plans concerning this.</div><div><div><div><br><br>On=
 Friday, January 24, 2014 8:43:28 PM UTC-5, <a>jba...@jbat.es</a> wrote:</d=
iv>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding=
-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-l=
eft-style:solid"><div dir=3D"ltr">Just realized I didn't really give any de=
tails for what I want to propose!<br>

<br>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 br=
aced-init-lists of the specified size. Maybe it would also match the interf=
ace of std::array and/or include some easy way to initialize std::arrays or=
 C-style arrays with it.<br>

<br>On Friday, January 24, 2014 3:36:40 PM UTC-10, <a>jba...@jbat.es</a> wr=
ote:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;pad=
ding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;bord=
er-left-style:solid">

<div dir=3D"ltr">I've been playing around with types that extend the functi=
onality of std::array. I want to add more constructors, but I also want to =
retain the aggregate initialization syntax, e.g.:<div>my_cool_array_type&lt=
;float, 4&gt; a =3D {1, 2, 3, 4};</div>

<div><br></div><div>Neither variadic templates nor initializer_list yield s=
atisfactory results. A good discussion as to why can be found in the follow=
ing SO question:&nbsp;<a href=3D"http://stackoverflow.com/questions/2134254=
5/implementing-stdarray-like-constructors-in-other-classes" target=3D"_blan=
k" onmousedown=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;" onclick=3D"this.href=3D'http://www.google.com/u=
rl?q\75http%3A%2F%2Fstackoverflow.com%2Fquestions%2F21342545%2Fimplementing=
-stdarray-like-constructors-in-other-classes\46sa\75D\46sntz\0751\46usg\75A=
FQjCNG4WYZNzlZEMWF8sLon3MEiUt_5Rw';return true;">http://<u></u>stackoverflo=
w<wbr>.com/questions/<u></u>21342545/<wbr>implementing-<u></u>stdarray-like=
-<wbr>constructors-in-<u></u>other-classes</a></div>

<div><br></div><div>initializer_list comes close, but it's not well-optimiz=
ed for generic fixed-sized containers. Is anyone opposed to a fixed-sized a=
lternative to initializer_list (maybe call it initializer_array)? I'm inter=
ested in writing a proposal.</div>

</div></blockquote></div></blockquote></div></div></div></blockquote></div>=
<div><div>

<p></p>

-- <br>
&nbsp;<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
HtONn1zgS6wJ" onmousedown=3D"this.href=3D'javascript:';return true;" onclic=
k=3D"this.href=3D'javascript:';return true;">std-proposal...@<wbr>isocpp.or=
g</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"HtONn1zgS6wJ" onmousedown=3D"this.href=3D'java=
script:';return true;" onclick=3D"this.href=3D'javascript:';return true;">s=
td-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank" onmousedown=3D"this.href=3D'http://groups=
..google.com/a/isocpp.org/group/std-proposals/';return true;" onclick=3D"thi=
s.href=3D'http://groups.google.com/a/isocpp.org/group/std-proposals/';retur=
n true;">http://groups.google.com/a/<wbr>isocpp.org/group/std-<wbr>proposal=
s/</a>.<br>
</div></div></blockquote></div><br></div>
</blockquote></div></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_4_4128052.1390789700976--

.