Topic: Multi-layer structured binding
Author: Antonio Perez <antonio@perezexcelsior.com>
Date: Mon, 15 May 2017 02:29:47 -0700 (PDT)
Raw View
------=_Part_742_70265926.1494840587705
Content-Type: multipart/alternative;
boundary="----=_Part_743_534405133.1494840587705"
------=_Part_743_534405133.1494840587705
Content-Type: text/plain; charset="UTF-8"
C++17 introduced structured binding. This is a great idea, and I applaud
the move. I propose a slight generalization to structured binding.
Currently, this is legal:
tuple a = {2, 3.7, tuple(5, 7)};
auto [x,y,z] = a;
//x = 2, y = 3.7, z = tuple(5,7)
I propose allowing structured binding over multiple levels:
tuple a = {2, 3.7, tuple(5, 7)};
auto [x,y,[z1,z2]] = a;
//x = 2, y = 3.7, z1 = 5, and z2 = 7
This move represents an intuitive generalization of the syntax, and I
believe it will make structured binding a more complete and useful language
feature.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/bd6f1f79-add9-41dd-bdbc-36134f7a8f00%40isocpp.org.
------=_Part_743_534405133.1494840587705
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>C++17 introduced structured binding. This is a great =
idea, and I applaud the move. I propose a slight generalization to structur=
ed binding.=C2=A0</div><div>Currently, this is legal:=C2=A0</div><div><div =
class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); border=
-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; word-wr=
ap: break-word;"><code class=3D"prettyprint"><div class=3D"subprettyprint">=
<span style=3D"color: #000;" class=3D"styled-by-prettify">tuple a </span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #066;=
" class=3D"styled-by-prettify">2</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pret=
tify">3.7</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> tuple</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">5</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span><font color=3D"#006666"><span sty=
le=3D"color: #066;" class=3D"styled-by-prettify">7</span></font><span style=
=3D"color: #660;" class=3D"styled-by-prettify">)};</span><font color=3D"#88=
0000"><span style=3D"color: #000;" class=3D"styled-by-prettify"> =C2=A0</sp=
an></font><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">[</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">x</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify">y</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">z</span><span style=3D"color: #660;" class=3D"styled-by-prettify">]</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> a</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br></span><span style=3D"color: #800;" class=3D"=
styled-by-prettify">//x =3D 2, y =3D 3.7, z =3D tuple(5,7)</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></code></d=
iv><br>I propose allowing structured binding over multiple levels:</div><di=
v><br></div><div><div class=3D"prettyprint" style=3D"background-color: rgb(=
250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; bord=
er-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div cla=
ss=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-prett=
ify">tuple a </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span=
style=3D"color: #066;" class=3D"styled-by-prettify">2</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">3.7</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> tuple</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">(</span><span style=3D"color: #066;" class=3D"styled-by-prettify">5</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><font color=
=3D"#006666"><span style=3D"color: #066;" class=3D"styled-by-prettify">7</s=
pan></font><span style=3D"color: #660;" class=3D"styled-by-prettify">)};</s=
pan><font color=3D"#880000"><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> =C2=A0</span></font><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">auto</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">[</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify">x</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify">y</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">,[</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">z1</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify">z2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
]]</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> a</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #800;" c=
lass=3D"styled-by-prettify">//x =3D 2, y =3D 3.7, z1 =3D 5, and z2 =3D 7</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></=
div></code></div><br>This move represents an intuitive generalization of th=
e syntax, and I believe it will make structured binding a more complete and=
useful language feature.=C2=A0</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/bd6f1f79-add9-41dd-bdbc-36134f7a8f00%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/bd6f1f79-add9-41dd-bdbc-36134f7a8f00=
%40isocpp.org</a>.<br />
------=_Part_743_534405133.1494840587705--
------=_Part_742_70265926.1494840587705--
.
Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Tue, 16 May 2017 00:05:53 +0200
Raw View
This is a multi-part message in MIME format.
--------------005C35979A96B38FAC486557
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: quoted-printable
Le 15/05/2017 =C3=A0 11:29, Antonio Perez a =C3=A9crit :
> C++17 introduced structured binding. This is a great idea, and I=20
> applaud the move. I propose a slight generalization to structured=20
> binding.
> Currently, this is legal:
> |
> tuple a =3D{2,3.7,tuple(5,7)};
> auto[x,y,z]=3Da;
> //x =3D 2, y =3D 3.7, z =3D tuple(5,7)
> |
>
> I propose allowing structured binding over multiple levels:
>
> |
> tuple a =3D{2,3.7,tuple(5,7)};
> auto[x,y,[z1,z2]]=3Da;
> //x =3D 2, y =3D 3.7, z1 =3D 5, and z2 =3D 7
> |
>
> This move represents an intuitive generalization of the syntax, and I=20
> believe it will make structured binding a more complete and useful=20
> language feature.
>
I don't believe there will be too much opposition to this feature.
Vicente
--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/8a7bd89a-171f-06c1-e59a-94e0a642d54c%40wanadoo.f=
r.
--------------005C35979A96B38FAC486557
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3Dutf-8" http-equiv=3D"Content-Type=
">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
<div class=3D"moz-cite-prefix">Le 15/05/2017 =C3=A0 11:29, Antonio Pere=
z a
=C3=A9crit=C2=A0:<br>
</div>
<blockquote
cite=3D"mid:bd6f1f79-add9-41dd-bdbc-36134f7a8f00@isocpp.org"
type=3D"cite">
<div dir=3D"ltr">
<div>C++17 introduced structured binding. This is a great idea,
and I applaud the move. I propose a slight generalization to
structured binding.=C2=A0</div>
<div>Currently, this is legal:=C2=A0</div>
<div>
<div class=3D"prettyprint" style=3D"background-color: rgb(250,
250, 250); border-color: rgb(187, 187, 187); border-style:
solid; border-width: 1px; word-wrap: break-word;"><code
class=3D"prettyprint">
<div class=3D"subprettyprint"><span style=3D"color: #000;"
class=3D"styled-by-prettify">tuple a </span><span
style=3D"color: #660;" class=3D"styled-by-prettify">=3D</=
span><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">{</sp=
an><span
style=3D"color: #066;" class=3D"styled-by-prettify">2</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
style=3D"color: #066;" class=3D"styled-by-prettify">3.7</=
span><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify"> tupl=
e</span><span
style=3D"color: #660;" class=3D"styled-by-prettify">(</sp=
an><span
style=3D"color: #066;" class=3D"styled-by-prettify">5</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><font
color=3D"#006666"><span style=3D"color: #066;"
class=3D"styled-by-prettify">7</span></font><span
style=3D"color: #660;" class=3D"styled-by-prettify">)};</=
span><font
color=3D"#880000"><span style=3D"color: #000;"
class=3D"styled-by-prettify"> =C2=A0</span></font><span
style=3D"color: #000;" class=3D"styled-by-prettify"><br>
</span><span style=3D"color: #008;"
class=3D"styled-by-prettify">auto</span><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">[</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify">x</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify">y</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify">z</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">]</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">=3D</=
span><span
style=3D"color: #000;" class=3D"styled-by-prettify"> a</s=
pan><span
style=3D"color: #660;" class=3D"styled-by-prettify">;</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify"><br>
</span><span style=3D"color: #800;"
class=3D"styled-by-prettify">//x =3D 2, y =3D 3.7, z =3D
tuple(5,7)</span><span style=3D"color: #000;"
class=3D"styled-by-prettify"><br>
</span></div>
</code></div>
<br>
I propose allowing structured binding over multiple levels:</div>
<div><br>
</div>
<div>
<div class=3D"prettyprint" style=3D"background-color: rgb(250,
250, 250); border-color: rgb(187, 187, 187); border-style:
solid; border-width: 1px; word-wrap: break-word;"><code
class=3D"prettyprint">
<div class=3D"subprettyprint"><span style=3D"color: #000;"
class=3D"styled-by-prettify">tuple a </span><span
style=3D"color: #660;" class=3D"styled-by-prettify">=3D</=
span><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">{</sp=
an><span
style=3D"color: #066;" class=3D"styled-by-prettify">2</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
style=3D"color: #066;" class=3D"styled-by-prettify">3.7</=
span><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify"> tupl=
e</span><span
style=3D"color: #660;" class=3D"styled-by-prettify">(</sp=
an><span
style=3D"color: #066;" class=3D"styled-by-prettify">5</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><font
color=3D"#006666"><span style=3D"color: #066;"
class=3D"styled-by-prettify">7</span></font><span
style=3D"color: #660;" class=3D"styled-by-prettify">)};</=
span><font
color=3D"#880000"><span style=3D"color: #000;"
class=3D"styled-by-prettify"> =C2=A0</span></font><span
style=3D"color: #000;" class=3D"styled-by-prettify"><br>
</span><span style=3D"color: #008;"
class=3D"styled-by-prettify">auto</span><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">[</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify">x</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify">y</sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">,[</s=
pan><span
style=3D"color: #000;" class=3D"styled-by-prettify">z1</s=
pan><span
style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify">z2</s=
pan><span
style=3D"color: #660;" class=3D"styled-by-prettify">]]</s=
pan><span
style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span
style=3D"color: #660;" class=3D"styled-by-prettify">=3D</=
span><span
style=3D"color: #000;" class=3D"styled-by-prettify"> a</s=
pan><span
style=3D"color: #660;" class=3D"styled-by-prettify">;</sp=
an><span
style=3D"color: #000;" class=3D"styled-by-prettify"><br>
</span><span style=3D"color: #800;"
class=3D"styled-by-prettify">//x =3D 2, y =3D 3.7, z1 =3D=
5,
and z2 =3D 7</span><span style=3D"color: #000;"
class=3D"styled-by-prettify"><br>
</span></div>
</code></div>
<br>
This move represents an intuitive generalization of the
syntax, and I believe it will make structured binding a more
complete and useful language feature.=C2=A0</div>
</div>
<br>
</blockquote>
<p>I don't believe there will be too much opposition to this
feature.</p>
<p>Vicente<br>
</p>
</body>
</html>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/8a7bd89a-171f-06c1-e59a-94e0a642d54c%=
40wanadoo.fr?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8a7bd89a-171f-06c1-e59a-94e0a642d54c=
%40wanadoo.fr</a>.<br />
--------------005C35979A96B38FAC486557--
.
Author: Richard Smith <richard@metafoo.co.uk>
Date: Mon, 15 May 2017 16:18:51 -0700
Raw View
--94eb2c12560a6aa8a9054f9848f8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On 15 May 2017 at 15:05, Vicente J. Botet Escriba <vicente.botet@wanadoo.fr=
>
wrote:
> Le 15/05/2017 =C3=A0 11:29, Antonio Perez a =C3=A9crit :
>
> C++17 introduced structured binding. This is a great idea, and I applaud
> the move. I propose a slight generalization to structured binding.
> Currently, this is legal:
> tuple a =3D {2, 3.7, tuple(5, 7)};
> auto [x,y,z] =3D a;
> //x =3D 2, y =3D 3.7, z =3D tuple(5,7)
>
> I propose allowing structured binding over multiple levels:
>
> tuple a =3D {2, 3.7, tuple(5, 7)};
> auto [x,y,[z1,z2]] =3D a;
> //x =3D 2, y =3D 3.7, z1 =3D 5, and z2 =3D 7
>
> This move represents an intuitive generalization of the syntax, and I
> believe it will make structured binding a more complete and useful langua=
ge
> feature.
>
> I don't believe there will be too much opposition to this feature.
>
There is a conflict between this and attribute syntax, which will need to
be ironed out before this extension can be accepted, but we did discuss
this before structured bindings were moved into the standard draft and it
was definitely an anticipated future direction.
--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAOfiQq%3DSed40x7grVx85f-Gizxidi7oXHkSWxmYh7oM9H=
j%2B0rw%40mail.gmail.com.
--94eb2c12560a6aa8a9054f9848f8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 1=
5 May 2017 at 15:05, Vicente J. Botet Escriba <span dir=3D"ltr"><<a href=
=3D"mailto:vicente.botet@wanadoo.fr" target=3D"_blank">vicente.botet@wanado=
o.fr</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000"><span class=3D"">
<div class=3D"m_-7732717386549342979moz-cite-prefix">Le 15/05/2017 =C3=
=A0 11:29, Antonio Perez a
=C3=A9crit=C2=A0:<br>
</div>
<blockquote type=3D"cite">
<div dir=3D"ltr">
<div>C++17 introduced structured binding. This is a great idea,
and I applaud the move. I propose a slight generalization to
structured binding.=C2=A0</div>
<div>Currently, this is legal:=C2=A0</div>
<div>
<div class=3D"m_-7732717386549342979prettyprint" style=3D"backgro=
und-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid=
;border-width:1px;word-wrap:break-word"><code class=3D"m_-77327173865493429=
79prettyprint">
<div class=3D"m_-7732717386549342979subprettyprint"><span sty=
le=3D"color:#000" class=3D"m_-7732717386549342979styled-by-prettify">tuple =
a </span><span style=3D"color:#660" class=3D"m_-7732717386549342979styled-b=
y-prettify">=3D</span><span style=3D"color:#000" class=3D"m_-77327173865493=
42979styled-by-prettify"> </span><span style=3D"color:#660" class=3D"m_-773=
2717386549342979styled-by-prettify">{</span><span style=3D"color:#066" clas=
s=3D"m_-7732717386549342979styled-by-prettify">2</span><span style=3D"color=
:#660" class=3D"m_-7732717386549342979styled-by-prettify">,</span><span sty=
le=3D"color:#000" class=3D"m_-7732717386549342979styled-by-prettify"> </spa=
n><span style=3D"color:#066" class=3D"m_-7732717386549342979styled-by-prett=
ify">3.7</span><span style=3D"color:#660" class=3D"m_-7732717386549342979st=
yled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-7732717386=
549342979styled-by-prettify"> tuple</span><span style=3D"color:#660" class=
=3D"m_-7732717386549342979styled-by-prettify">(</span><span style=3D"color:=
#066" class=3D"m_-7732717386549342979styled-by-prettify">5</span><span styl=
e=3D"color:#660" class=3D"m_-7732717386549342979styled-by-prettify">,</span=
><span style=3D"color:#000" class=3D"m_-7732717386549342979styled-by-pretti=
fy"> </span><font color=3D"#006666"><span style=3D"color:#066" class=3D"m_-=
7732717386549342979styled-by-prettify">7</span></font><span style=3D"color:=
#660" class=3D"m_-7732717386549342979styled-by-prettify">)};</span><font co=
lor=3D"#880000"><span style=3D"color:#000" class=3D"m_-7732717386549342979s=
tyled-by-prettify"> =C2=A0</span></font><span style=3D"color:#000" class=3D=
"m_-7732717386549342979styled-by-prettify"><br>
</span><span style=3D"color:#008" class=3D"m_-7732717386549=
342979styled-by-prettify">auto</span><span style=3D"color:#000" class=3D"m_=
-7732717386549342979styled-by-prettify"> </span><span style=3D"color:#660" =
class=3D"m_-7732717386549342979styled-by-prettify">[</span><span style=3D"c=
olor:#000" class=3D"m_-7732717386549342979styled-by-prettify">x</span><span=
style=3D"color:#660" class=3D"m_-7732717386549342979styled-by-prettify">,<=
/span><span style=3D"color:#000" class=3D"m_-7732717386549342979styled-by-p=
rettify">y</span><span style=3D"color:#660" class=3D"m_-7732717386549342979=
styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-77327173=
86549342979styled-by-prettify">z</span><span style=3D"color:#660" class=3D"=
m_-7732717386549342979styled-by-prettify">]</span><span style=3D"color:#000=
" class=3D"m_-7732717386549342979styled-by-prettify"> </span><span style=3D=
"color:#660" class=3D"m_-7732717386549342979styled-by-prettify">=3D</span><=
span style=3D"color:#000" class=3D"m_-7732717386549342979styled-by-prettify=
"> a</span><span style=3D"color:#660" class=3D"m_-7732717386549342979styled=
-by-prettify">;</span><span style=3D"color:#000" class=3D"m_-77327173865493=
42979styled-by-prettify"><br>
</span><span style=3D"color:#800" class=3D"m_-7732717386549=
342979styled-by-prettify">//x =3D 2, y =3D 3.7, z =3D
tuple(5,7)</span><span style=3D"color:#000" class=3D"m_-7=
732717386549342979styled-by-prettify"><br>
</span></div>
</code></div>
<br>
I propose allowing structured binding over multiple levels:</div>
<div><br>
</div>
<div>
<div class=3D"m_-7732717386549342979prettyprint" style=3D"backgro=
und-color:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid=
;border-width:1px;word-wrap:break-word"><code class=3D"m_-77327173865493429=
79prettyprint">
<div class=3D"m_-7732717386549342979subprettyprint"><span sty=
le=3D"color:#000" class=3D"m_-7732717386549342979styled-by-prettify">tuple =
a </span><span style=3D"color:#660" class=3D"m_-7732717386549342979styled-b=
y-prettify">=3D</span><span style=3D"color:#000" class=3D"m_-77327173865493=
42979styled-by-prettify"> </span><span style=3D"color:#660" class=3D"m_-773=
2717386549342979styled-by-prettify">{</span><span style=3D"color:#066" clas=
s=3D"m_-7732717386549342979styled-by-prettify">2</span><span style=3D"color=
:#660" class=3D"m_-7732717386549342979styled-by-prettify">,</span><span sty=
le=3D"color:#000" class=3D"m_-7732717386549342979styled-by-prettify"> </spa=
n><span style=3D"color:#066" class=3D"m_-7732717386549342979styled-by-prett=
ify">3.7</span><span style=3D"color:#660" class=3D"m_-7732717386549342979st=
yled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-7732717386=
549342979styled-by-prettify"> tuple</span><span style=3D"color:#660" class=
=3D"m_-7732717386549342979styled-by-prettify">(</span><span style=3D"color:=
#066" class=3D"m_-7732717386549342979styled-by-prettify">5</span><span styl=
e=3D"color:#660" class=3D"m_-7732717386549342979styled-by-prettify">,</span=
><span style=3D"color:#000" class=3D"m_-7732717386549342979styled-by-pretti=
fy"> </span><font color=3D"#006666"><span style=3D"color:#066" class=3D"m_-=
7732717386549342979styled-by-prettify">7</span></font><span style=3D"color:=
#660" class=3D"m_-7732717386549342979styled-by-prettify">)};</span><font co=
lor=3D"#880000"><span style=3D"color:#000" class=3D"m_-7732717386549342979s=
tyled-by-prettify"> =C2=A0</span></font><span style=3D"color:#000" class=3D=
"m_-7732717386549342979styled-by-prettify"><br>
</span><span style=3D"color:#008" class=3D"m_-7732717386549=
342979styled-by-prettify">auto</span><span style=3D"color:#000" class=3D"m_=
-7732717386549342979styled-by-prettify"> </span><span style=3D"color:#660" =
class=3D"m_-7732717386549342979styled-by-prettify">[</span><span style=3D"c=
olor:#000" class=3D"m_-7732717386549342979styled-by-prettify">x</span><span=
style=3D"color:#660" class=3D"m_-7732717386549342979styled-by-prettify">,<=
/span><span style=3D"color:#000" class=3D"m_-7732717386549342979styled-by-p=
rettify">y</span><span style=3D"color:#660" class=3D"m_-7732717386549342979=
styled-by-prettify">,[</span><span style=3D"color:#000" class=3D"m_-7732717=
386549342979styled-by-prettify">z1</span><span style=3D"color:#660" class=
=3D"m_-7732717386549342979styled-by-prettify">,</span><span style=3D"color:=
#000" class=3D"m_-7732717386549342979styled-by-prettify">z2</span><span sty=
le=3D"color:#660" class=3D"m_-7732717386549342979styled-by-prettify">]]</sp=
an><span style=3D"color:#000" class=3D"m_-7732717386549342979styled-by-pret=
tify"> </span><span style=3D"color:#660" class=3D"m_-7732717386549342979sty=
led-by-prettify">=3D</span><span style=3D"color:#000" class=3D"m_-773271738=
6549342979styled-by-prettify"> a</span><span style=3D"color:#660" class=3D"=
m_-7732717386549342979styled-by-prettify">;</span><span style=3D"color:#000=
" class=3D"m_-7732717386549342979styled-by-prettify"><br>
</span><span style=3D"color:#800" class=3D"m_-7732717386549=
342979styled-by-prettify">//x =3D 2, y =3D 3.7, z1 =3D 5,
and z2 =3D 7</span><span style=3D"color:#000" class=3D"m_=
-7732717386549342979styled-by-prettify"><br>
</span></div>
</code></div>
<br>
This move represents an intuitive generalization of the
syntax, and I believe it will make structured binding a more
complete and useful language feature.=C2=A0</div>
</div>
<br>
</blockquote>
</span><p>I don't believe there will be too much opposition to this
feature.</p></div></blockquote><div>There is a conflict between this =
and attribute syntax, which will need to be ironed out before this extensio=
n can be accepted, but we did discuss this before structured bindings were =
moved into the standard draft and it was definitely an anticipated future d=
irection.<br></div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAOfiQq%3DSed40x7grVx85f-Gizxidi7oXHk=
SWxmYh7oM9Hj%2B0rw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOfiQq%3DSed=
40x7grVx85f-Gizxidi7oXHkSWxmYh7oM9Hj%2B0rw%40mail.gmail.com</a>.<br />
--94eb2c12560a6aa8a9054f9848f8--
.
Author: Antonio Perez <antonio@perezexcelsior.com>
Date: Tue, 16 May 2017 06:41:30 -0700 (PDT)
Raw View
------=_Part_2169_1584975047.1494942090816
Content-Type: multipart/alternative;
boundary="----=_Part_2170_1321215363.1494942090817"
------=_Part_2170_1321215363.1494942090817
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Oh! Good! So it's probably something that'll be seen in C++20?
On Monday, May 15, 2017 at 5:19:13 PM UTC-6, Richard Smith wrote:
>
> On 15 May 2017 at 15:05, Vicente J. Botet Escriba <vicent...@wanadoo.fr=
=20
> <javascript:>> wrote:
>
>> Le 15/05/2017 =C3=A0 11:29, Antonio Perez a =C3=A9crit :
>>
>> C++17 introduced structured binding. This is a great idea, and I applaud=
=20
>> the move. I propose a slight generalization to structured binding.=20
>> Currently, this is legal:=20
>> tuple a =3D {2, 3.7, tuple(5, 7)}; =20
>> auto [x,y,z] =3D a;
>> //x =3D 2, y =3D 3.7, z =3D tuple(5,7)
>>
>> I propose allowing structured binding over multiple levels:
>>
>> tuple a =3D {2, 3.7, tuple(5, 7)}; =20
>> auto [x,y,[z1,z2]] =3D a;
>> //x =3D 2, y =3D 3.7, z1 =3D 5, and z2 =3D 7
>>
>> This move represents an intuitive generalization of the syntax, and I=20
>> believe it will make structured binding a more complete and useful langu=
age=20
>> feature.=20
>>
>> I don't believe there will be too much opposition to this feature.
>>
> There is a conflict between this and attribute syntax, which will need to=
=20
> be ironed out before this extension can be accepted, but we did discuss=
=20
> this before structured bindings were moved into the standard draft and it=
=20
> was definitely an anticipated future direction.
>
--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/8e2b1c8b-fdb3-45ce-8bb3-fb8bf2708370%40isocpp.or=
g.
------=_Part_2170_1321215363.1494942090817
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Oh! Good! So it's probably something that'll be se=
en in C++20?<br><br>On Monday, May 15, 2017 at 5:19:13 PM UTC-6, Richard Sm=
ith wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:=
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><di=
v><div class=3D"gmail_quote">On 15 May 2017 at 15:05, Vicente J. Botet Escr=
iba <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-obf=
uscated-mailto=3D"RFyaUDHoCQAJ" rel=3D"nofollow" onmousedown=3D"this.href=
=3D'javascript:';return true;" onclick=3D"this.href=3D'javascri=
pt:';return true;">vicent...@wanadoo.fr</a>></span> wrote:<br><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
solid;padding-left:1ex">
=20
=20
=20
<div bgcolor=3D"#FFFFFF" text=3D"#000000"><span>
<div>Le 15/05/2017 =C3=A0 11:29, Antonio Perez a
=C3=A9crit=C2=A0:<br>
</div>
<blockquote type=3D"cite">
<div dir=3D"ltr">
<div>C++17 introduced structured binding. This is a great idea,
and I applaud the move. I propose a slight generalization to
structured binding.=C2=A0</div>
<div>Currently, this is legal:=C2=A0</div>
<div>
<div style=3D"background-color:rgb(250,250,250);border-color:rgb(=
187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><cod=
e>
<div><span style=3D"color:#000">tuple a </span><span style=3D=
"color:#660">=3D</span><span style=3D"color:#000"> </span><span style=3D"co=
lor:#660">{</span><span style=3D"color:#066">2</span><span style=3D"color:#=
660">,</span><span style=3D"color:#000"> </span><span style=3D"color:#066">=
3.7</span><span style=3D"color:#660">,</span><span style=3D"color:#000"> tu=
ple</span><span style=3D"color:#660">(</span><span style=3D"color:#066">5</=
span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </span>=
<font color=3D"#006666"><span style=3D"color:#066">7</span></font><span sty=
le=3D"color:#660">)};</span><font color=3D"#880000"><span style=3D"color:#0=
00"> =C2=A0</span></font><span style=3D"color:#000"><br>
</span><span style=3D"color:#008">auto</span><span style=3D=
"color:#000"> </span><span style=3D"color:#660">[</span><span style=3D"colo=
r:#000">x</span><span style=3D"color:#660">,</span><span style=3D"color:#00=
0">y</span><span style=3D"color:#660">,</span><span style=3D"color:#000">z<=
/span><span style=3D"color:#660">]</span><span style=3D"color:#000"> </span=
><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> a</span><=
span style=3D"color:#660">;</span><span style=3D"color:#000"><br>
</span><span style=3D"color:#800">//x =3D 2, y =3D 3.7, z =
=3D
tuple(5,7)</span><span style=3D"color:#000"><br>
</span></div>
</code></div>
<br>
I propose allowing structured binding over multiple levels:</div>
<div><br>
</div>
<div>
<div style=3D"background-color:rgb(250,250,250);border-color:rgb(=
187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"><cod=
e>
<div><span style=3D"color:#000">tuple a </span><span style=3D=
"color:#660">=3D</span><span style=3D"color:#000"> </span><span style=3D"co=
lor:#660">{</span><span style=3D"color:#066">2</span><span style=3D"color:#=
660">,</span><span style=3D"color:#000"> </span><span style=3D"color:#066">=
3.7</span><span style=3D"color:#660">,</span><span style=3D"color:#000"> tu=
ple</span><span style=3D"color:#660">(</span><span style=3D"color:#066">5</=
span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </span>=
<font color=3D"#006666"><span style=3D"color:#066">7</span></font><span sty=
le=3D"color:#660">)};</span><font color=3D"#880000"><span style=3D"color:#0=
00"> =C2=A0</span></font><span style=3D"color:#000"><br>
</span><span style=3D"color:#008">auto</span><span style=3D=
"color:#000"> </span><span style=3D"color:#660">[</span><span style=3D"colo=
r:#000">x</span><span style=3D"color:#660">,</span><span style=3D"color:#00=
0">y</span><span style=3D"color:#660">,[</span><span style=3D"color:#000">z=
1</span><span style=3D"color:#660">,</span><span style=3D"color:#000">z2</s=
pan><span style=3D"color:#660">]]</span><span style=3D"color:#000"> </span>=
<span style=3D"color:#660">=3D</span><span style=3D"color:#000"> a</span><s=
pan style=3D"color:#660">;</span><span style=3D"color:#000"><br>
</span><span style=3D"color:#800">//x =3D 2, y =3D 3.7, z1 =
=3D 5,
and z2 =3D 7</span><span style=3D"color:#000"><br>
</span></div>
</code></div>
<br>
This move represents an intuitive generalization of the
syntax, and I believe it will make structured binding a more
complete and useful language feature.=C2=A0</div>
</div>
<br>
</blockquote>
</span><p>I don't believe there will be too much opposition to this
feature.</p></div></blockquote><div>There is a conflict between this =
and attribute syntax, which will need to be ironed out before this extensio=
n can be accepted, but we did discuss this before structured bindings were =
moved into the standard draft and it was definitely an anticipated future d=
irection.<br></div></div></div></div>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/8e2b1c8b-fdb3-45ce-8bb3-fb8bf2708370%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8e2b1c8b-fdb3-45ce-8bb3-fb8bf2708370=
%40isocpp.org</a>.<br />
------=_Part_2170_1321215363.1494942090817--
------=_Part_2169_1584975047.1494942090816--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 16 May 2017 07:17:51 -0700 (PDT)
Raw View
------=_Part_2177_294718835.1494944271411
Content-Type: multipart/alternative;
boundary="----=_Part_2178_546034570.1494944271411"
------=_Part_2178_546034570.1494944271411
Content-Type: text/plain; charset="UTF-8"
On Tuesday, May 16, 2017 at 9:41:31 AM UTC-4, Antonio Perez wrote:
>
> Oh! Good! So it's probably something that'll be seen in C++20?
>
Only if someone actually makes a proposal for it and pushes it. The main
point is that the designers of structured binding anticipated that this
would be a logical next step. That doesn't mean it will happen, only that
it was anticipated that this was desired.
--
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/34f2485b-5cf9-4145-87db-1ae034781d49%40isocpp.org.
------=_Part_2178_546034570.1494944271411
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Tuesday, May 16, 2017 at 9:41:31 AM UTC-4, Antonio Pere=
z wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">Oh! G=
ood! So it's probably something that'll be seen in C++20?</div></bl=
ockquote><div><br>Only if someone actually makes a proposal for it and push=
es it. The main point is that the designers of structured binding anticipat=
ed that this would be a logical next step. That doesn't mean it will ha=
ppen, only that it was anticipated that this was desired.<br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;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"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/34f2485b-5cf9-4145-87db-1ae034781d49%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/34f2485b-5cf9-4145-87db-1ae034781d49=
%40isocpp.org</a>.<br />
------=_Part_2178_546034570.1494944271411--
------=_Part_2177_294718835.1494944271411--
.