Topic: Extensions to structured bindings - Zip


Author: "'Michael Davies' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 12 Dec 2016 14:33:52 -0800 (PST)
Raw View
------=_Part_1414_1306172954.1481582032015
Content-Type: multipart/alternative;
 boundary="----=_Part_1415_945940973.1481582032016"

------=_Part_1415_945940973.1481582032016
Content-Type: text/plain; charset=UTF-8

Hi,

With C++17 introducing structured bindings so that we may unpack things
such as tuples and pairs and give them meaningful names, is there anything
in the works to make a something akin to zip() in Python? If not. Is this
something we should be looking at? Of course, there are ways to achieve the
same effect in C++ but I am unaware of anything that makes the process as
simple other than including boosts very own version of zip. Following this,
maybe there are other things we can do to enrich structured bindings such
as maybe splitting datasets down the middle? An example may be something
like:


auto packedModelData = {
    { 10.0f, 30.0f, 10.0f, 0.5f, 1.0f }, //XYZ Coordinates of point in
space and UV coordinates for texturing.
    { 5.0f 0.0f, 10.0f, 0.0f, 0.0f },
    { 15.0f, 0.0f, 10.0f, 1.0f, 0.0f }
};

void AddToBuffer(std::tuple<float, float, float> loc) //auto would evaluate
to best possible matching type?
{
    ...
}

void AddToTextureBuffer(std::pair<float, float> texCoord)
{
    ...
}

for(auto& [x,y,z][u,v] : packedModelData) //Possibly [x,y,z],[u,v] instead
of [x,y,z][u,v]?
{
    AddToBuffer([x,y,z]);
    AddToTextureBuffer([u,v]);
}

Thanks,
Michael Davies

--
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/4bf04a5d-a825-4ce1-a84e-b1199db861eb%40isocpp.org.

------=_Part_1415_945940973.1481582032016
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<br><br>With C++17 introducing structured bindings so t=
hat we may unpack things such as tuples and pairs and give them meaningful =
names, is there anything in the works to make a something akin to zip()=C2=
=A0in Python? If not. Is this something we should be looking at? Of course,=
 there are ways to achieve the same effect in C++ but I am unaware of anyth=
ing that makes the process as simple other than including boosts very own v=
ersion of zip. Following this, maybe there are other things we can do to en=
rich structured bindings such as maybe splitting datasets down the middle? =
An example may be something like:<br><br><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 clas=
s=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> packedModelData </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span><span style=3D"color: #066;" class=3D"styled-by-prettify">10.0f</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><font color=3D"=
#006666"><span style=3D"color: #066;" class=3D"styled-by-prettify">30.0f</s=
pan><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;" class=3D"styled-by-prettify">10.0f</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D=
"styled-by-prettify">0.5f</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">1.0=
f</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">},</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #800;" class=3D"styled-by-prettify">//XYZ Coordinates of point in space=
 and UV coordinates for texturing.</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span></font><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">=C2=A0 =C2=A0 </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;" class=3D"styled-by=
-prettify">5.0f</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">0.0f=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">10.0f</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=
=3D"styled-by-prettify">0.0f</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">=
0.0f</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">},</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">15.0f</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"s=
tyled-by-prettify">0.0f</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">10.0f=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><font color=
=3D"#006666"><span style=3D"color: #066;" class=3D"styled-by-prettify">1.0f=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">0.0f</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">}</span></font><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">};</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br><br></span><span style=3D"color: #008;" class=3D"styled=
-by-prettify">void</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">A=
ddToBuffer</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">std</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify">tuple</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">float</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">float</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">float=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> loc</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: r=
gb(136, 0, 0);"><span style=3D"color: #800;" class=3D"styled-by-prettify">/=
/auto would evaluate to best possible matching type?</span></span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">...</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br><br></span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">void</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-prettif=
y">AddToTextureBuffer</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify">pair</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">float</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: #008;" =
class=3D"styled-by-prettify">float</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> texCoord</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>...</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">for</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">[</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">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 styl=
e=3D"color: #000;" class=3D"styled-by-prettify">z</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">][</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify">u</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">v</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">]</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> packedModelData</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #800;" class=3D"styled-by-prettify">//Possibly </span><span style=3D"=
color: #800;" class=3D"styled-by-prettify">[x,y,z],[u,v] instead of [x,y,z]=
[u,v]?</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 <=
/span><span style=3D"color: #606;" class=3D"styled-by-prettify">AddToBuffer=
</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 styl=
e=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"colo=
r: #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-b=
y-prettify">]);</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #606;" class=3D"styled-=
by-prettify">AddToTextureBuffer</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">([</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify">u</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">,</span><font color=3D"#000000"><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">v</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">]);</span></font><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">}</span></div></code></div><div><br></div><div>Thanks,</div><div>Michae=
l Davies</div></div>

<p></p>

-- <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+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/4bf04a5d-a825-4ce1-a84e-b1199db861eb%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4bf04a5d-a825-4ce1-a84e-b1199db861eb=
%40isocpp.org</a>.<br />

------=_Part_1415_945940973.1481582032016--

------=_Part_1414_1306172954.1481582032015--

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 12 Dec 2016 15:53:08 -0800 (PST)
Raw View
------=_Part_5619_331750431.1481586788608
Content-Type: multipart/alternative;
 boundary="----=_Part_5620_1373813749.1481586788609"

------=_Part_5620_1373813749.1481586788609
Content-Type: text/plain; charset=UTF-8



On Monday, December 12, 2016 at 5:33:52 PM UTC-5, Michael Davies wrote:
>
> Hi,
>
> With C++17 introducing structured bindings so that we may unpack things
> such as tuples and pairs and give them meaningful names, is there anything
> in the works to make a something akin to zip() in Python? If not. Is this
> something we should be looking at? Of course, there are ways to achieve the
> same effect in C++ but I am unaware of anything that makes the process as
> simple other than including boosts very own version of zip. Following this,
> maybe there are other things we can do to enrich structured bindings such
> as maybe splitting datasets down the middle? An example may be something
> like:
>
>
> auto packedModelData = {
>     { 10.0f, 30.0f, 10.0f, 0.5f, 1.0f }, //XYZ Coordinates of point in
> space and UV coordinates for texturing.
>     { 5.0f 0.0f, 10.0f, 0.0f, 0.0f },
>     { 15.0f, 0.0f, 10.0f, 1.0f, 0.0f }
> };
>
> void AddToBuffer(std::tuple<float, float, float> loc) //auto would
> evaluate to best possible matching type?
> {
>     ...
> }
>
> void AddToTextureBuffer(std::pair<float, float> texCoord)
> {
>     ...
> }
>
> for(auto& [x,y,z][u,v] : packedModelData) //Possibly [x,y,z],[u,v]
> instead of [x,y,z][u,v]?
> {
>     AddToBuffer([x,y,z]);
>     AddToTextureBuffer([u,v]);
> }
>
>
I'm not sure I understand your example here. In particular, why would
`AddToBuffer` take tuples? Why not have them be variadic functions? So you
call `AddToBuffer(x, y, z)`, which we already know how to do.

I don't see a need for a language version of `make_tuple`. Or `zip`.
Library functionality seems reasonable enough.

--
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/07a36417-a416-4335-9f64-5199ca840102%40isocpp.org.

------=_Part_5620_1373813749.1481586788609
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, December 12, 2016 at 5:33:52 PM UTC-5, =
Michael Davies wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr">Hi,<br><br>With C++17 introducing structured bindings so that we m=
ay unpack things such as tuples and pairs and give them meaningful names, i=
s there anything in the works to make a something akin to zip()=C2=A0in Pyt=
hon? If not. Is this something we should be looking at? Of course, there ar=
e ways to achieve the same effect in C++ but I am unaware of anything that =
makes the process as simple other than including boosts very own version of=
 zip. Following this, maybe there are other things we can do to enrich stru=
ctured bindings such as maybe splitting datasets down the middle? An exampl=
e may be something like:<br><br><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"><code><div><span style=3D"color:#000"><br></span><span st=
yle=3D"color:#008">auto</span><span style=3D"color:#000"> packedModelData <=
/span><span style=3D"color:#660">=3D</span><span style=3D"color:#000"> </sp=
an><span style=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0=
 =C2=A0 </span><span style=3D"color:#660">{</span><span style=3D"color:#000=
"> </span><span style=3D"color:#066">10.0f</span><span style=3D"color:#660"=
>,</span><span style=3D"color:#000"> </span><font color=3D"#006666"><span s=
tyle=3D"color:#066">30.0f</span><span style=3D"color:#660">,</span><span st=
yle=3D"color:#000"> </span><span style=3D"color:#066">10.0f</span><span sty=
le=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=3D=
"color:#066">0.5f</span><span style=3D"color:#660">,</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#066">1.0f</span><span style=3D"col=
or:#000"> </span><span style=3D"color:#660">},</span><span style=3D"color:#=
000"> </span><span style=3D"color:#800">//XYZ Coordinates of point in space=
 and UV coordinates for texturing.</span><span style=3D"color:#000"><br></s=
pan></font><span style=3D"color:#000">=C2=A0 =C2=A0 </span><span style=3D"c=
olor:#660">{</span><span style=3D"color:#000"> </span><span style=3D"color:=
#066">5.0f</span><span style=3D"color:#000"> </span><span style=3D"color:#0=
66">0.0f</span><span style=3D"color:#660">,</span><span style=3D"color:#000=
"> </span><span style=3D"color:#066">10.0f</span><span style=3D"color:#660"=
>,</span><span style=3D"color:#000"> </span><span style=3D"color:#066">0.0f=
</span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </spa=
n><span style=3D"color:#066">0.0f</span><span style=3D"color:#000"> </span>=
<span style=3D"color:#660">},</span><span style=3D"color:#000"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color:#660">{</span><span style=3D"color:#000"=
> </span><span style=3D"color:#066">15.0f</span><span style=3D"color:#660">=
,</span><span style=3D"color:#000"> </span><span style=3D"color:#066">0.0f<=
/span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </span=
><span style=3D"color:#066">10.0f</span><span style=3D"color:#660">,</span>=
<span style=3D"color:#000"> </span><font color=3D"#006666"><span style=3D"c=
olor:#066">1.0f</span><span style=3D"color:#660">,</span><span style=3D"col=
or:#000"> </span><span style=3D"color:#066">0.0f</span><span style=3D"color=
:#000"> </span><span style=3D"color:#660">}</span></font><span style=3D"col=
or:#000"><br></span><span style=3D"color:#660">};</span><span style=3D"colo=
r:#000"><br><br></span><span style=3D"color:#008">void</span><span style=3D=
"color:#000"> </span><span style=3D"color:#606">AddToBuffer</span><span sty=
le=3D"color:#660">(</span><span style=3D"color:#000">std</span><span style=
=3D"color:#660">::</span><span style=3D"color:#000">tuple</span><span style=
=3D"color:#660">&lt;</span><span style=3D"color:#008">float</span><span sty=
le=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=3D=
"color:#008">float</span><span style=3D"color:#660">,</span><span style=3D"=
color:#000"> </span><span style=3D"color:#008">float</span><span style=3D"c=
olor:#660">&gt;</span><span style=3D"color:#000"> loc</span><span style=3D"=
color:#660">)</span><span style=3D"color:#000"> </span><span style=3D"color=
:rgb(136,0,0)"><span style=3D"color:#800">//auto would evaluate to best pos=
sible matching type?</span></span><span style=3D"color:#000"><br></span><sp=
an style=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=
=A0 </span><span style=3D"color:#660">...</span><span style=3D"color:#000">=
<br></span><span style=3D"color:#660">}</span><span style=3D"color:#000"><b=
r><br></span><span style=3D"color:#008">void</span><span style=3D"color:#00=
0"> </span><span style=3D"color:#606">AddToTextureBuffer</span><span style=
=3D"color:#660">(</span><span style=3D"color:#000">std</span><span style=3D=
"color:#660">::</span><span style=3D"color:#000">pair</span><span style=3D"=
color:#660">&lt;</span><span style=3D"color:#008">f<wbr>loat</span><span st=
yle=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=
=3D"color:#008">float</span><span style=3D"color:#660">&gt;</span><span sty=
le=3D"color:#000"> texCoord</span><span style=3D"color:#660">)</span><span =
style=3D"color:#000"><br></span><span style=3D"color:#660">{</span><span st=
yle=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660">...<=
/span><span style=3D"color:#000"><br></span><span style=3D"color:#660">}</s=
pan><span style=3D"color:#000"><br><br></span><span style=3D"color:#008">fo=
r</span><span style=3D"color:#660">(</span><span style=3D"color:#008">auto<=
/span><span style=3D"color:#660">&amp;</span><span style=3D"color:#000"> </=
span><span style=3D"color:#660">[</span><span style=3D"color:#000">x</span>=
<span style=3D"color:#660">,</span><span style=3D"color:#000">y</span><span=
 style=3D"color:#660">,</span><span style=3D"color:#000">z</span><span styl=
e=3D"color:#660">][</span><span style=3D"color:#000">u</span><span style=3D=
"color:#660">,</span><span style=3D"color:#000">v</span><span style=3D"colo=
r:#660">]</span><span style=3D"color:#000"> </span><span style=3D"color:#66=
0">:</span><span style=3D"color:#000"> packedModelData</span><span style=3D=
"color:#660">)</span><span style=3D"color:#000"> </span><span style=3D"colo=
r:#800">//Possibly </span><span style=3D"color:#800">[x,y,z],[u,v] instead =
of [x,y,z][u,v]?</span><span style=3D"color:#000"><br></span><span style=3D=
"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><s=
pan style=3D"color:#606">AddToBuffer</span><span style=3D"color:#660">([</s=
pan><span style=3D"color:#000">x</span><span style=3D"color:#660">,</span><=
span style=3D"color:#000">y</span><span style=3D"color:#660">,</span><span =
style=3D"color:#000">z</span><span style=3D"color:#660">]);</span><span sty=
le=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#606">AddTo=
TextureBuffer</span><span style=3D"color:#660">([</span><span style=3D"colo=
r:#000">u</span><span style=3D"color:#660">,</span><font color=3D"#000000">=
<span style=3D"color:#000">v</span><span style=3D"color:#660">]);</span></f=
ont><span style=3D"color:#000"><br></span><span style=3D"color:#660">}</spa=
n></div></code></div><div><br></div></div></blockquote><div><br>I&#39;m not=
 sure I understand your example here. In particular, why would `AddToBuffer=
` take tuples? Why not have them be variadic functions? So you call `AddToB=
uffer(x, y, z)`, which we already know how to do.<br><br>I don&#39;t see a =
need for a language version of `make_tuple`. Or `zip`. Library functionalit=
y seems reasonable enough.<br></div></div>

<p></p>

-- <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+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/07a36417-a416-4335-9f64-5199ca840102%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/07a36417-a416-4335-9f64-5199ca840102=
%40isocpp.org</a>.<br />

------=_Part_5620_1373813749.1481586788609--

------=_Part_5619_331750431.1481586788608--

.


Author: Richard Smith <richard@metafoo.co.uk>
Date: Mon, 12 Dec 2016 16:17:22 -0800
Raw View
--94eb2c1901f81d1c7205437f26c4
Content-Type: text/plain; charset=UTF-8

On 12 December 2016 at 14:33, 'Michael Davies' via ISO C++ Standard -
Future Proposals <std-proposals@isocpp.org> wrote:

> Hi,
>
> With C++17 introducing structured bindings so that we may unpack things
> such as tuples and pairs and give them meaningful names, is there anything
> in the works to make a something akin to zip() in Python? If not. Is this
> something we should be looking at? Of course, there are ways to achieve the
> same effect in C++ but I am unaware of anything that makes the process as
> simple other than including boosts very own version of zip. Following this,
> maybe there are other things we can do to enrich structured bindings such
> as maybe splitting datasets down the middle? An example may be something
> like:
>
>
> auto packedModelData = {
>     { 10.0f, 30.0f, 10.0f, 0.5f, 1.0f }, //XYZ Coordinates of point in
> space and UV coordinates for texturing.
>     { 5.0f 0.0f, 10.0f, 0.0f, 0.0f },
>     { 15.0f, 0.0f, 10.0f, 1.0f, 0.0f }
> };
>
> void AddToBuffer(std::tuple<float, float, float> loc) //auto would
> evaluate to best possible matching type?
> {
>     ...
> }
>
> void AddToTextureBuffer(std::pair<float, float> texCoord)
> {
>     ...
> }
>
> for(auto& [x,y,z][u,v] : packedModelData) //Possibly [x,y,z],[u,v]
> instead of [x,y,z][u,v]?
> {
>     AddToBuffer([x,y,z]);
>     AddToTextureBuffer([u,v]);
> }
>

What's wrong with

for (auto& [x, y, z, u, v] : packedModelData)
{
  AddToBuffer({x, y, z});
  AddToTextureBuffer({u, v});
}

? What is the problem that needs to be solved here? (I also don't see how
the above example relates to zip; that looks much more like an unzip to me.)

Thanks,
> Michael Davies
>
> --
> 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/4bf04a5d-a825-4ce1-
> a84e-b1199db861eb%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4bf04a5d-a825-4ce1-a84e-b1199db861eb%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

--
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/CAOfiQqn5Wan9%2BUSbWx174At7UdgayojcGZBYbQFaRieCZoNnCQ%40mail.gmail.com.

--94eb2c1901f81d1c7205437f26c4
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=
2 December 2016 at 14:33, &#39;Michael Davies&#39; via ISO C++ Standard - F=
uture Proposals <span dir=3D"ltr">&lt;<a href=3D"mailto:std-proposals@isocp=
p.org" target=3D"_blank">std-proposals@isocpp.org</a>&gt;</span> wrote:<br>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hi,<br><br>With C++17 intro=
ducing structured bindings so that we may unpack things such as tuples and =
pairs and give them meaningful names, is there anything in the works to mak=
e a something akin to zip()=C2=A0in Python? If not. Is this something we sh=
ould be looking at? Of course, there are ways to achieve the same effect in=
 C++ but I am unaware of anything that makes the process as simple other th=
an including boosts very own version of zip. Following this, maybe there ar=
e other things we can do to enrich structured bindings such as maybe splitt=
ing datasets down the middle? An example may be something like:<br><br><div=
 class=3D"m_-4070459939753183712prettyprint" 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"m_-4070459939753183712prettyprint"=
><div class=3D"m_-4070459939753183712subprettyprint"><span style=3D"color:#=
000" class=3D"m_-4070459939753183712styled-by-prettify"><br></span><span st=
yle=3D"color:#008" class=3D"m_-4070459939753183712styled-by-prettify">auto<=
/span><span style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-p=
rettify"> packedModelData </span><span style=3D"color:#660" class=3D"m_-407=
0459939753183712styled-by-prettify">=3D</span><span style=3D"color:#000" cl=
ass=3D"m_-4070459939753183712styled-by-prettify"> </span><span style=3D"col=
or:#660" class=3D"m_-4070459939753183712styled-by-prettify">{</span><span s=
tyle=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"><br>=
=C2=A0 =C2=A0 </span><span style=3D"color:#660" class=3D"m_-407045993975318=
3712styled-by-prettify">{</span><span style=3D"color:#000" class=3D"m_-4070=
459939753183712styled-by-prettify"> </span><span style=3D"color:#066" class=
=3D"m_-4070459939753183712styled-by-prettify">10.0f</span><span style=3D"co=
lor:#660" class=3D"m_-4070459939753183712styled-by-prettify">,</span><span =
style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"> </=
span><font color=3D"#006666"><span style=3D"color:#066" class=3D"m_-4070459=
939753183712styled-by-prettify">30.0f</span><span style=3D"color:#660" clas=
s=3D"m_-4070459939753183712styled-by-prettify">,</span><span style=3D"color=
:#000" class=3D"m_-4070459939753183712styled-by-prettify"> </span><span sty=
le=3D"color:#066" class=3D"m_-4070459939753183712styled-by-prettify">10.0f<=
/span><span style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-p=
rettify">,</span><span style=3D"color:#000" class=3D"m_-4070459939753183712=
styled-by-prettify"> </span><span style=3D"color:#066" class=3D"m_-40704599=
39753183712styled-by-prettify">0.5f</span><span style=3D"color:#660" class=
=3D"m_-4070459939753183712styled-by-prettify">,</span><span style=3D"color:=
#000" class=3D"m_-4070459939753183712styled-by-prettify"> </span><span styl=
e=3D"color:#066" class=3D"m_-4070459939753183712styled-by-prettify">1.0f</s=
pan><span style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-pre=
ttify"> </span><span style=3D"color:#660" class=3D"m_-4070459939753183712st=
yled-by-prettify">},</span><span style=3D"color:#000" class=3D"m_-407045993=
9753183712styled-by-prettify"> </span><span style=3D"color:#800" class=3D"m=
_-4070459939753183712styled-by-prettify">//XYZ Coordinates of point in spac=
e and UV coordinates for texturing.</span><span style=3D"color:#000" class=
=3D"m_-4070459939753183712styled-by-prettify"><br></span></font><span style=
=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify">=C2=A0 =
=C2=A0 </span><span style=3D"color:#660" class=3D"m_-4070459939753183712sty=
led-by-prettify">{</span><span style=3D"color:#000" class=3D"m_-40704599397=
53183712styled-by-prettify"> </span><span style=3D"color:#066" class=3D"m_-=
4070459939753183712styled-by-prettify">5.0f</span><span style=3D"color:#000=
" class=3D"m_-4070459939753183712styled-by-prettify"> </span><span style=3D=
"color:#066" class=3D"m_-4070459939753183712styled-by-prettify">0.0f</span>=
<span style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettif=
y">,</span><span style=3D"color:#000" class=3D"m_-4070459939753183712styled=
-by-prettify"> </span><span style=3D"color:#066" class=3D"m_-40704599397531=
83712styled-by-prettify">10.0f</span><span style=3D"color:#660" class=3D"m_=
-4070459939753183712styled-by-prettify">,</span><span style=3D"color:#000" =
class=3D"m_-4070459939753183712styled-by-prettify"> </span><span style=3D"c=
olor:#066" class=3D"m_-4070459939753183712styled-by-prettify">0.0f</span><s=
pan style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettify"=
>,</span><span style=3D"color:#000" class=3D"m_-4070459939753183712styled-b=
y-prettify"> </span><span style=3D"color:#066" class=3D"m_-4070459939753183=
712styled-by-prettify">0.0f</span><span style=3D"color:#000" class=3D"m_-40=
70459939753183712styled-by-prettify"> </span><span style=3D"color:#660" cla=
ss=3D"m_-4070459939753183712styled-by-prettify">},</span><span style=3D"col=
or:#000" class=3D"m_-4070459939753183712styled-by-prettify"><br>=C2=A0 =C2=
=A0 </span><span style=3D"color:#660" class=3D"m_-4070459939753183712styled=
-by-prettify">{</span><span style=3D"color:#000" class=3D"m_-40704599397531=
83712styled-by-prettify"> </span><span style=3D"color:#066" class=3D"m_-407=
0459939753183712styled-by-prettify">15.0f</span><span style=3D"color:#660" =
class=3D"m_-4070459939753183712styled-by-prettify">,</span><span style=3D"c=
olor:#000" class=3D"m_-4070459939753183712styled-by-prettify"> </span><span=
 style=3D"color:#066" class=3D"m_-4070459939753183712styled-by-prettify">0.=
0f</span><span style=3D"color:#660" class=3D"m_-4070459939753183712styled-b=
y-prettify">,</span><span style=3D"color:#000" class=3D"m_-4070459939753183=
712styled-by-prettify"> </span><span style=3D"color:#066" class=3D"m_-40704=
59939753183712styled-by-prettify">10.0f</span><span style=3D"color:#660" cl=
ass=3D"m_-4070459939753183712styled-by-prettify">,</span><span style=3D"col=
or:#000" class=3D"m_-4070459939753183712styled-by-prettify"> </span><font c=
olor=3D"#006666"><span style=3D"color:#066" class=3D"m_-4070459939753183712=
styled-by-prettify">1.0f</span><span style=3D"color:#660" class=3D"m_-40704=
59939753183712styled-by-prettify">,</span><span style=3D"color:#000" class=
=3D"m_-4070459939753183712styled-by-prettify"> </span><span style=3D"color:=
#066" class=3D"m_-4070459939753183712styled-by-prettify">0.0f</span><span s=
tyle=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"> </s=
pan><span style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-pre=
ttify">}</span></font><span style=3D"color:#000" class=3D"m_-40704599397531=
83712styled-by-prettify"><br></span><span style=3D"color:#660" class=3D"m_-=
4070459939753183712styled-by-prettify">};</span><span style=3D"color:#000" =
class=3D"m_-4070459939753183712styled-by-prettify"><br><br></span><span sty=
le=3D"color:#008" class=3D"m_-4070459939753183712styled-by-prettify">void</=
span><span style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-pr=
ettify"> </span><span style=3D"color:#606" class=3D"m_-4070459939753183712s=
tyled-by-prettify">AddToBuffer</span><span style=3D"color:#660" class=3D"m_=
-4070459939753183712styled-by-prettify">(</span><span style=3D"color:#000" =
class=3D"m_-4070459939753183712styled-by-prettify">std</span><span style=3D=
"color:#660" class=3D"m_-4070459939753183712styled-by-prettify">::</span><s=
pan style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"=
>tuple</span><span style=3D"color:#660" class=3D"m_-4070459939753183712styl=
ed-by-prettify">&lt;</span><span style=3D"color:#008" class=3D"m_-407045993=
9753183712styled-by-prettify">float</span><span style=3D"color:#660" class=
=3D"m_-4070459939753183712styled-by-prettify">,</span><span style=3D"color:=
#000" class=3D"m_-4070459939753183712styled-by-prettify"> </span><span styl=
e=3D"color:#008" class=3D"m_-4070459939753183712styled-by-prettify">float</=
span><span style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-pr=
ettify">,</span><span style=3D"color:#000" class=3D"m_-4070459939753183712s=
tyled-by-prettify"> </span><span style=3D"color:#008" class=3D"m_-407045993=
9753183712styled-by-prettify">float</span><span style=3D"color:#660" class=
=3D"m_-4070459939753183712styled-by-prettify">&gt;</span><span style=3D"col=
or:#000" class=3D"m_-4070459939753183712styled-by-prettify"> loc</span><spa=
n style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettify">)=
</span><span style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-=
prettify"> </span><span style=3D"color:rgb(136,0,0)"><span style=3D"color:#=
800" class=3D"m_-4070459939753183712styled-by-prettify">//auto would evalua=
te to best possible matching type?</span></span><span style=3D"color:#000" =
class=3D"m_-4070459939753183712styled-by-prettify"><br></span><span style=
=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettify">{</span>=
<span style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettif=
y"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660" class=3D"m_-40704599=
39753183712styled-by-prettify">...</span><span style=3D"color:#000" class=
=3D"m_-4070459939753183712styled-by-prettify"><br></span><span style=3D"col=
or:#660" class=3D"m_-4070459939753183712styled-by-prettify">}</span><span s=
tyle=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"><br>=
<br></span><span style=3D"color:#008" class=3D"m_-4070459939753183712styled=
-by-prettify">void</span><span style=3D"color:#000" class=3D"m_-40704599397=
53183712styled-by-prettify"> </span><span style=3D"color:#606" class=3D"m_-=
4070459939753183712styled-by-prettify">AddToTextureBuffer</span><span style=
=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettify">(</span>=
<span style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettif=
y">std</span><span style=3D"color:#660" class=3D"m_-4070459939753183712styl=
ed-by-prettify">::</span><span style=3D"color:#000" class=3D"m_-40704599397=
53183712styled-by-prettify">pair</span><span style=3D"color:#660" class=3D"=
m_-4070459939753183712styled-by-prettify">&lt;</span><span style=3D"color:#=
008" class=3D"m_-4070459939753183712styled-by-prettify">f<wbr>loat</span><s=
pan style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettify"=
>,</span><span style=3D"color:#000" class=3D"m_-4070459939753183712styled-b=
y-prettify"> </span><span style=3D"color:#008" class=3D"m_-4070459939753183=
712styled-by-prettify">float</span><span style=3D"color:#660" class=3D"m_-4=
070459939753183712styled-by-prettify">&gt;</span><span style=3D"color:#000"=
 class=3D"m_-4070459939753183712styled-by-prettify"> texCoord</span><span s=
tyle=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettify">)</s=
pan><span style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-pre=
ttify"><br></span><span style=3D"color:#660" class=3D"m_-407045993975318371=
2styled-by-prettify">{</span><span style=3D"color:#000" class=3D"m_-4070459=
939753183712styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"col=
or:#660" class=3D"m_-4070459939753183712styled-by-prettify">...</span><span=
 style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"><b=
r></span><span style=3D"color:#660" class=3D"m_-4070459939753183712styled-b=
y-prettify">}</span><span style=3D"color:#000" class=3D"m_-4070459939753183=
712styled-by-prettify"><br><br></span><span style=3D"color:#008" class=3D"m=
_-4070459939753183712styled-by-prettify">for</span><span style=3D"color:#66=
0" class=3D"m_-4070459939753183712styled-by-prettify">(</span><span style=
=3D"color:#008" class=3D"m_-4070459939753183712styled-by-prettify">auto</sp=
an><span style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-pret=
tify">&amp;</span><span style=3D"color:#000" class=3D"m_-407045993975318371=
2styled-by-prettify"> </span><span style=3D"color:#660" class=3D"m_-4070459=
939753183712styled-by-prettify">[</span><span style=3D"color:#000" class=3D=
"m_-4070459939753183712styled-by-prettify">x</span><span style=3D"color:#66=
0" class=3D"m_-4070459939753183712styled-by-prettify">,</span><span style=
=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify">y</span>=
<span style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettif=
y">,</span><span style=3D"color:#000" class=3D"m_-4070459939753183712styled=
-by-prettify">z</span><span style=3D"color:#660" class=3D"m_-40704599397531=
83712styled-by-prettify">][</span><span style=3D"color:#000" class=3D"m_-40=
70459939753183712styled-by-prettify">u</span><span style=3D"color:#660" cla=
ss=3D"m_-4070459939753183712styled-by-prettify">,</span><span style=3D"colo=
r:#000" class=3D"m_-4070459939753183712styled-by-prettify">v</span><span st=
yle=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettify">]</sp=
an><span style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-pret=
tify"> </span><span style=3D"color:#660" class=3D"m_-4070459939753183712sty=
led-by-prettify">:</span><span style=3D"color:#000" class=3D"m_-40704599397=
53183712styled-by-prettify"> packedModelData</span><span style=3D"color:#66=
0" class=3D"m_-4070459939753183712styled-by-prettify">)</span><span style=
=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"> </span>=
<span style=3D"color:#800" class=3D"m_-4070459939753183712styled-by-prettif=
y">//Possibly </span><span style=3D"color:#800" class=3D"m_-407045993975318=
3712styled-by-prettify">[x,y,z],[u,v] instead of [x,y,z][u,v]?</span><span =
style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"><br=
></span><span style=3D"color:#660" class=3D"m_-4070459939753183712styled-by=
-prettify">{</span><span style=3D"color:#000" class=3D"m_-40704599397531837=
12styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#606" c=
lass=3D"m_-4070459939753183712styled-by-prettify">AddToBuffer</span><span s=
tyle=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prettify">([</=
span><span style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-pr=
ettify">x</span><span style=3D"color:#660" class=3D"m_-4070459939753183712s=
tyled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-407045993=
9753183712styled-by-prettify">y</span><span style=3D"color:#660" class=3D"m=
_-4070459939753183712styled-by-prettify">,</span><span style=3D"color:#000"=
 class=3D"m_-4070459939753183712styled-by-prettify">z</span><span style=3D"=
color:#660" class=3D"m_-4070459939753183712styled-by-prettify">]);</span><s=
pan style=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"=
><br>=C2=A0 =C2=A0 </span><span style=3D"color:#606" class=3D"m_-4070459939=
753183712styled-by-prettify">AddToTextureBuffer</span><span style=3D"color:=
#660" class=3D"m_-4070459939753183712styled-by-prettify">([</span><span sty=
le=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify">u</spa=
n><span style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-prett=
ify">,</span><font color=3D"#000000"><span style=3D"color:#000" class=3D"m_=
-4070459939753183712styled-by-prettify">v</span><span style=3D"color:#660" =
class=3D"m_-4070459939753183712styled-by-prettify">]);</span></font><span s=
tyle=3D"color:#000" class=3D"m_-4070459939753183712styled-by-prettify"><br>=
</span><span style=3D"color:#660" class=3D"m_-4070459939753183712styled-by-=
prettify">}</span></div></code></div></div></blockquote><div><br></div><div=
>What&#39;s wrong with</div><div><br></div><div>for (auto&amp; [x, y, z, u,=
 v] : packedModelData)</div><div>{</div><div>=C2=A0 AddToBuffer({x, y, z});=
</div><div>=C2=A0 AddToTextureBuffer({u, v});</div><div>}</div><div><br></d=
iv><div>? What is the problem that needs to be solved here? (I also don&#39=
;t see how the above example relates to zip; that looks much more like an u=
nzip to me.)</div><div><br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D=
"ltr"><div>Thanks,</div><div>Michael Davies</div></div><span class=3D"HOEnZ=
b"><font color=3D"#888888">

<p></p>

-- <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+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>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>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/4bf04a5d-a825-4ce1-a84e-b1199db861eb%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/4bf0=
4a5d-a825-4ce1-<wbr>a84e-b1199db861eb%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></div></div>

<p></p>

-- <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+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/CAOfiQqn5Wan9%2BUSbWx174At7UdgayojcGZ=
BYbQFaRieCZoNnCQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOfiQqn5Wan9%2=
BUSbWx174At7UdgayojcGZBYbQFaRieCZoNnCQ%40mail.gmail.com</a>.<br />

--94eb2c1901f81d1c7205437f26c4--

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Mon, 12 Dec 2016 19:19:05 -0800 (PST)
Raw View
------=_Part_974_2114530704.1481599145115
Content-Type: multipart/alternative;
 boundary="----=_Part_975_588998323.1481599145116"

------=_Part_975_588998323.1481599145116
Content-Type: text/plain; charset=UTF-8



On Monday, December 12, 2016 at 7:17:44 PM UTC-5, Richard Smith wrote:
>
> On 12 December 2016 at 14:33, 'Michael Davies' via ISO C++ Standard -
> Future Proposals <std-pr...@isocpp.org <javascript:>> wrote:
>
>> Hi,
>>
>> With C++17 introducing structured bindings so that we may unpack things
>> such as tuples and pairs and give them meaningful names, is there anything
>> in the works to make a something akin to zip() in Python? If not. Is this
>> something we should be looking at? Of course, there are ways to achieve the
>> same effect in C++ but I am unaware of anything that makes the process as
>> simple other than including boosts very own version of zip. Following this,
>> maybe there are other things we can do to enrich structured bindings such
>> as maybe splitting datasets down the middle? An example may be something
>> like:
>>
>>
>> auto packedModelData = {
>>     { 10.0f, 30.0f, 10.0f, 0.5f, 1.0f }, //XYZ Coordinates of point in
>> space and UV coordinates for texturing.
>>     { 5.0f 0.0f, 10.0f, 0.0f, 0.0f },
>>     { 15.0f, 0.0f, 10.0f, 1.0f, 0.0f }
>> };
>>
>> void AddToBuffer(std::tuple<float, float, float> loc) //auto would
>> evaluate to best possible matching type?
>> {
>>     ...
>> }
>>
>> void AddToTextureBuffer(std::pair<float, float> texCoord)
>> {
>>     ...
>> }
>>
>> for(auto& [x,y,z][u,v] : packedModelData) //Possibly [x,y,z],[u,v]
>> instead of [x,y,z][u,v]?
>> {
>>     AddToBuffer([x,y,z]);
>>     AddToTextureBuffer([u,v]);
>> }
>>
>
> What's wrong with
>
> for (auto& [x, y, z, u, v] : packedModelData)
> {
>   AddToBuffer({x, y, z});
>   AddToTextureBuffer({u, v});
> }
>
> ? What is the problem that needs to be solved here? (I also don't see how
> the above example relates to zip; that looks much more like an unzip to me.)
>

To be fair, that won't work. But it will only not work because
`packedModelData` is an `initializer_list<initializer_list<float>>`. And
`initializer_list` has no `get<I>` overloads.

--
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/b589e4c0-0880-4e6d-b84c-e2340927a7bc%40isocpp.org.

------=_Part_975_588998323.1481599145116
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, December 12, 2016 at 7:17:44 PM UTC-5, =
Richard Smith wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div><div class=3D"gmail_quote">On 12 December 2016 at 14:33, &#39=
;Michael Davies&#39; via ISO C++ Standard - Future Proposals <span dir=3D"l=
tr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
bpeIhUVOCQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">std-pr...@isocpp.org</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">Hi,<br><br>With C++17 introducing structured bindings=
 so that we may unpack things such as tuples and pairs and give them meanin=
gful names, is there anything in the works to make a something akin to zip(=
)=C2=A0in Python? If not. Is this something we should be looking at? Of cou=
rse, there are ways to achieve the same effect in C++ but I am unaware of a=
nything that makes the process as simple other than including boosts very o=
wn version of zip. Following this, maybe there are other things we can do t=
o enrich structured bindings such as maybe splitting datasets down the midd=
le? An example may be something like:<br><br><div style=3D"background-color=
:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-w=
idth:1px;word-wrap:break-word"><code><div><span style=3D"color:#000"><br></=
span><span style=3D"color:#008">auto</span><span style=3D"color:#000"> pack=
edModelData </span><span style=3D"color:#660">=3D</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#660">{</span><span style=3D"color:#00=
0"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660">{</span><span style=
=3D"color:#000"> </span><span style=3D"color:#066">10.0f</span><span style=
=3D"color:#660">,</span><span style=3D"color:#000"> </span><font color=3D"#=
006666"><span style=3D"color:#066">30.0f</span><span style=3D"color:#660">,=
</span><span style=3D"color:#000"> </span><span style=3D"color:#066">10.0f<=
/span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </span=
><span style=3D"color:#066">0.5f</span><span style=3D"color:#660">,</span><=
span style=3D"color:#000"> </span><span style=3D"color:#066">1.0f</span><sp=
an style=3D"color:#000"> </span><span style=3D"color:#660">},</span><span s=
tyle=3D"color:#000"> </span><span style=3D"color:#800">//XYZ Coordinates of=
 point in space and UV coordinates for texturing.</span><span style=3D"colo=
r:#000"><br></span></font><span style=3D"color:#000">=C2=A0 =C2=A0 </span><=
span style=3D"color:#660">{</span><span style=3D"color:#000"> </span><span =
style=3D"color:#066">5.0f</span><span style=3D"color:#000"> </span><span st=
yle=3D"color:#066">0.0f</span><span style=3D"color:#660">,</span><span styl=
e=3D"color:#000"> </span><span style=3D"color:#066">10.0f</span><span style=
=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#066">0.0f</span><span style=3D"color:#660">,</span><span style=3D"col=
or:#000"> </span><span style=3D"color:#066">0.0f</span><span style=3D"color=
:#000"> </span><span style=3D"color:#660">},</span><span style=3D"color:#00=
0"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#660">{</span><span style=
=3D"color:#000"> </span><span style=3D"color:#066">15.0f</span><span style=
=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#066">0.0f</span><span style=3D"color:#660">,</span><span style=3D"col=
or:#000"> </span><span style=3D"color:#066">10.0f</span><span style=3D"colo=
r:#660">,</span><span style=3D"color:#000"> </span><font color=3D"#006666">=
<span style=3D"color:#066">1.0f</span><span style=3D"color:#660">,</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#066">0.0f</span><spa=
n style=3D"color:#000"> </span><span style=3D"color:#660">}</span></font><s=
pan style=3D"color:#000"><br></span><span style=3D"color:#660">};</span><sp=
an style=3D"color:#000"><br><br></span><span style=3D"color:#008">void</spa=
n><span style=3D"color:#000"> </span><span style=3D"color:#606">AddToBuffer=
</span><span style=3D"color:#660">(</span><span style=3D"color:#000">std</s=
pan><span style=3D"color:#660">::</span><span style=3D"color:#000">tuple</s=
pan><span style=3D"color:#660">&lt;</span><span style=3D"color:#008">float<=
/span><span style=3D"color:#660">,</span><span style=3D"color:#000"> </span=
><span style=3D"color:#008">float</span><span style=3D"color:#660">,</span>=
<span style=3D"color:#000"> </span><span style=3D"color:#008">float</span><=
span style=3D"color:#660">&gt;</span><span style=3D"color:#000"> loc</span>=
<span style=3D"color:#660">)</span><span style=3D"color:#000"> </span><span=
 style=3D"color:rgb(136,0,0)"><span style=3D"color:#800">//auto would evalu=
ate to best possible matching type?</span></span><span style=3D"color:#000"=
><br></span><span style=3D"color:#660">{</span><span style=3D"color:#000"><=
br>=C2=A0 =C2=A0 </span><span style=3D"color:#660">...</span><span style=3D=
"color:#000"><br></span><span style=3D"color:#660">}</span><span style=3D"c=
olor:#000"><br><br></span><span style=3D"color:#008">void</span><span style=
=3D"color:#000"> </span><span style=3D"color:#606">AddToTextureBuffer</span=
><span style=3D"color:#660">(</span><span style=3D"color:#000">std</span><s=
pan style=3D"color:#660">::</span><span style=3D"color:#000">pair</span><sp=
an style=3D"color:#660">&lt;</span><span style=3D"color:#008">f<wbr>loat</s=
pan><span style=3D"color:#660">,</span><span style=3D"color:#000"> </span><=
span style=3D"color:#008">float</span><span style=3D"color:#660">&gt;</span=
><span style=3D"color:#000"> texCoord</span><span style=3D"color:#660">)</s=
pan><span style=3D"color:#000"><br></span><span style=3D"color:#660">{</spa=
n><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:=
#660">...</span><span style=3D"color:#000"><br></span><span style=3D"color:=
#660">}</span><span style=3D"color:#000"><br><br></span><span style=3D"colo=
r:#008">for</span><span style=3D"color:#660">(</span><span style=3D"color:#=
008">auto</span><span style=3D"color:#660">&amp;</span><span style=3D"color=
:#000"> </span><span style=3D"color:#660">[</span><span style=3D"color:#000=
">x</span><span style=3D"color:#660">,</span><span style=3D"color:#000">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">u</span><spa=
n style=3D"color:#660">,</span><span style=3D"color:#000">v</span><span sty=
le=3D"color:#660">]</span><span style=3D"color:#000"> </span><span style=3D=
"color:#660">:</span><span style=3D"color:#000"> packedModelData</span><spa=
n style=3D"color:#660">)</span><span style=3D"color:#000"> </span><span sty=
le=3D"color:#800">//Possibly </span><span style=3D"color:#800">[x,y,z],[u,v=
] instead of [x,y,z][u,v]?</span><span style=3D"color:#000"><br></span><spa=
n style=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0=
 </span><span style=3D"color:#606">AddToBuffer</span><span style=3D"color:#=
660">([</span><span style=3D"color:#000">x</span><span style=3D"color:#660"=
>,</span><span style=3D"color:#000">y</span><span style=3D"color:#660">,</s=
pan><span style=3D"color:#000">z</span><span style=3D"color:#660">]);</span=
><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#=
606">AddToTextureBuffer</span><span style=3D"color:#660">([</span><span sty=
le=3D"color:#000">u</span><span style=3D"color:#660">,</span><font color=3D=
"#000000"><span style=3D"color:#000">v</span><span style=3D"color:#660">]);=
</span></font><span style=3D"color:#000"><br></span><span style=3D"color:#6=
60">}</span></div></code></div></div></blockquote><div><br></div><div>What&=
#39;s wrong with</div><div><br></div><div>for (auto&amp; [x, y, z, u, v] : =
packedModelData)</div><div>{</div><div>=C2=A0 AddToBuffer({x, y, z});</div>=
<div>=C2=A0 AddToTextureBuffer({u, v});</div><div>}</div><div><br></div><di=
v>? What is the problem that needs to be solved here? (I also don&#39;t see=
 how the above example relates to zip; that looks much more like an unzip t=
o me.)</div></div></div></div></blockquote><div><br>To be fair, that won&#3=
9;t work. But it will only not work because `packedModelData` is an `initia=
lizer_list&lt;initializer_list&lt;float&gt;&gt;`. And `initializer_list` ha=
s no `get&lt;I&gt;` overloads.</div></div>

<p></p>

-- <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+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/b589e4c0-0880-4e6d-b84c-e2340927a7bc%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/b589e4c0-0880-4e6d-b84c-e2340927a7bc=
%40isocpp.org</a>.<br />

------=_Part_975_588998323.1481599145116--

------=_Part_974_2114530704.1481599145115--

.


Author: "'Michael Davies' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Tue, 13 Dec 2016 01:40:49 -0800 (PST)
Raw View
------=_Part_1765_189457027.1481622049918
Content-Type: multipart/alternative;
 boundary="----=_Part_1766_629762375.1481622049918"

------=_Part_1766_629762375.1481622049918
Content-Type: text/plain; charset=UTF-8



On Monday, December 12, 2016 at 11:53:08 PM UTC, Nicol Bolas wrote:

>
> I'm not sure I understand your example here. In particular, why would
> `AddToBuffer` take tuples? Why not have them be variadic functions? So you
> call `AddToBuffer(x, y, z)`, which we already know how to do.
>
> I don't see a need for a language version of `make_tuple`. Or `zip`.
> Library functionality seems reasonable enough.
>

This probably isn't the best example to be honest. But simply this would
work to show more clear reasoning when separating the data into different
sets. And could be used to reason a grouped object if there was any need
for such a thing. Of course you could have them be variadic functions but
you would lose meaning if you were just to look at the x, y, z by
themselves. By having something akin to [x,y,z] you're saying "These
variables should be grouped together as they are important to one another."
A more prudent example may be if you wanted to create a scaled wirefrrame
model. The u,v coordinates in that regard would be unimportant. So you may
want to construct a new vector including only the relevant information. Or,
you may(for some weird reason) want to transfer the UV coordinates to
multiple models.

std::vector<std::tuple<float, float, float>> scaledModel;
std::vector<std::pair<float, float>> uvCoords;

for(auto& [x,y,z][u,v] : packedModelData)
{
    scaledModel.push_back([x,y,z]);
    uvCoords.push_back([u,v]);
}

Scale(&scaledModel, 2.0f);
Draw(cube, uvCoords);
Draw(sphere, uvCoords);
Draw(pyramid, uvCoords);

--
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/ae0ba2a4-1516-410d-bdb9-87f9aa729cf4%40isocpp.org.

------=_Part_1766_629762375.1481622049918
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Monday, December 12, 2016 at 11:53:08 PM UTC, N=
icol Bolas wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div><br>I&#39;m not sure I understand your example here. In parti=
cular, why would `AddToBuffer` take tuples? Why not have them be variadic f=
unctions? So you call `AddToBuffer(x, y, z)`, which we already know how to =
do.<br><br>I don&#39;t see a need for a language version of `make_tuple`. O=
r `zip`. Library functionality seems reasonable enough.<br></div></div></bl=
ockquote><div><br>This probably isn&#39;t the best example to be honest. Bu=
t simply this would work to show more clear reasoning when separating the d=
ata into different sets. And could be used to reason a grouped object if th=
ere was any need for such a thing. Of course you could have them be variadi=
c functions but you would lose meaning if you were just to look at the x, y=
, z by themselves. By having something akin to [x,y,z] you&#39;re saying &q=
uot;These variables should be grouped together as they are important to one=
 another.&quot; A more prudent example may be if you wanted to create a sca=
led wirefrrame model. The u,v coordinates in that regard would be unimporta=
nt. So you may want to construct a new vector including only the relevant i=
nformation. Or, you may(for some weird reason) want to transfer the UV coor=
dinates to multiple models.<br><br><div style=3D"background-color: rgb(250,=
 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-w=
idth: 1px; overflow-wrap: break-word;" class=3D"prettyprint"><code class=3D=
"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">std</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">vector</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify">tuple</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">float</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: #008;" =
class=3D"styled-by-prettify">float</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: #008;" class=3D"styled-by-pret=
tify">float</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>&gt;&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
scaledModel</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>std<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">vector</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">std</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">pair</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">float</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">flo=
at</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;&gt;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> uvCoords<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><span=
 style=3D"color: #008;" class=3D"styled-by-prettify">for</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">[</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">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 styl=
e=3D"color: #000;" class=3D"styled-by-prettify">z</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">][</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify">u</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">v</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">]</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> packedModelData</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 scaledModel</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">push_back</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">([</span><span style=3D"colo=
r: #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-b=
y-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y">z</span><span style=3D"color: #660;" class=3D"styled-by-prettify">]);</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 uvCoords</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">push=
_back</span><span style=3D"color: #660;" class=3D"styled-by-prettify">([</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify">u</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify">v</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">]);</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br><br></span><span style=3D"color: #606;" class=3D"styled-=
by-prettify">Scale</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(&amp;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">scaledModel</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #066;" class=3D"styled-by-prettify">2.0f</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"c=
olor: #606;" class=3D"styled-by-prettify">Draw</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">cube</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> uvCoords</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">);</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"></span><br><code class=3D"prettyprint"><span style=3D"color: #606;" clas=
s=3D"styled-by-prettify">Draw</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">(</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify"></span></code><code class=3D"prettyprint"><span style=3D"color: #=
660;" class=3D"styled-by-prettify"><code class=3D"prettyprint"><span style=
=3D"color: #000;" class=3D"styled-by-prettify">sphere</span></code>,</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> uvCoords</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"></span></code><br><code cl=
ass=3D"prettyprint"><code class=3D"prettyprint"><span style=3D"color: #606;=
" class=3D"styled-by-prettify">Draw</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">(</span></code><code class=3D"prettyprint"><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify"><code class=3D"prettypri=
nt"><span style=3D"color: #000;" class=3D"styled-by-prettify"></span></code=
></span></code></code><code class=3D"prettyprint"><code class=3D"prettyprin=
t"><span style=3D"color: #660;" class=3D"styled-by-prettify"><code class=3D=
"prettyprint"><code class=3D"prettyprint"><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify"><code class=3D"prettyprint"><span style=3D"color: =
#000;" class=3D"styled-by-prettify">pyramid</span></code></span></code></co=
de>,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> uvCoo=
rds</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></co=
de></code></div></code></div></div></div>

<p></p>

-- <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+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/ae0ba2a4-1516-410d-bdb9-87f9aa729cf4%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ae0ba2a4-1516-410d-bdb9-87f9aa729cf4=
%40isocpp.org</a>.<br />

------=_Part_1766_629762375.1481622049918--

------=_Part_1765_189457027.1481622049918--

.


Author: "'Michael Davies' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Tue, 13 Dec 2016 02:33:51 -0800 (PST)
Raw View
------=_Part_1580_1759392520.1481625231895
Content-Type: multipart/alternative;
 boundary="----=_Part_1581_1051347228.1481625231896"

------=_Part_1581_1051347228.1481625231896
Content-Type: text/plain; charset=UTF-8


On Monday, December 12, 2016 at 11:53:08 PM UTC, Nicol Bolas wrote:
I'm not sure I understand your example here. In particular, why would
`AddToBuffer` take tuples? Why not have them be variadic functions? So you
call `AddToBuffer(x, y, z)`, which we already know how to do.

I don't see a need for a language version of `make_tuple`. Or `zip`.
Library functionality seems reasonable enough.

This



On Tuesday, December 13, 2016 at 12:17:44 AM UTC, Richard Smith wrote:
>
>
> What's wrong with
>
> for (auto& [x, y, z, u, v] : packedModelData)
> {
>   AddToBuffer({x, y, z});
>   AddToTextureBuffer({u, v});
> }
>
> ? What is the problem that needs to be solved here? (I also don't see how
> the above example relates to zip; that looks much more like an unzip to me.)
>

There is nothing particularly wrong with what you said but if you're doing
multiple calls which is passing in {x, y, z} doesn't the compiler create
multiple temporary tuples? Or is this optimized away? I think with gcc this
is at least on more assembly call to recreate the tuple for each time you
use it. Rather, I'm saying that [x, y, z][u, v] would, in this example,
form two distinct objects. So [x, y, z] would be created only once. Any
instance of [x, y, z] inside the for loop would therefore default to the
object created to represent that dataset. In this case, a std::tuple<float,
float, float>. And this is what is moved into the function. Essentially it
would be equate to something like:

auto& coords { packedModelData[0], packedModelData[1], packedModelData[2] };
auto& uvCoords { packedModelData[3], packedModelData[4] };

AddToBuffer(coords);
AddToBuffer(coords);
AddToBuffer(coords);

AddToTextureBuffer(uvCoords);
AddToTextureBuffer(uvCoords);
AddToTextureBuffer(uvCoords);

--
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/6e87c91d-9334-4558-b690-29816008f326%40isocpp.org.

------=_Part_1581_1051347228.1481625231896
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br>On Monday, December 12, 2016 at 11:53:08 PM UTC, Nicol=
 Bolas wrote:<br>I&#39;m
 not sure I understand your example here. In particular, why would=20
`AddToBuffer` take tuples? Why not have them be variadic functions? So=20
you call `AddToBuffer(x, y, z)`, which we already know how to do.<br><br>I =
don&#39;t see a need for a language version of `make_tuple`. Or `zip`. Libr=
ary functionality seems reasonable enough.<br><br>This <br><br><br><br>On T=
uesday, December 13, 2016 at 12:17:44 AM UTC, Richard Smith wrote:<blockquo=
te 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><div class=3D"gma=
il_quote"><br><div>What&#39;s wrong with</div><div><br></div><div>for (auto=
&amp; [x, y, z, u, v] : packedModelData)</div><div>{</div><div>=C2=A0 AddTo=
Buffer({x, y, z});</div><div>=C2=A0 AddToTextureBuffer({u, v});</div><div>}=
</div><div><br></div><div>?
 What is the problem that needs to be solved here? (I also don&#39;t see ho=
w
 the above example relates to zip; that looks much more like an unzip to
 me.)</div></div></div></div></blockquote><div>=C2=A0<br>There is nothing p=
articularly wrong with what you said but if you&#39;re doing multiple calls=
 which is passing in {x, y, z} doesn&#39;t the compiler create multiple tem=
porary tuples? Or is this optimized away? I think with gcc this is at least=
 on more assembly call to recreate the tuple for each time you use it. Rath=
er, I&#39;m saying that [x, y, z][u, v] would, in this example, form two di=
stinct objects. So [x, y, z] would be created only once. Any instance of [x=
, y, z] inside the for loop would therefore default to the object created t=
o represent that dataset. In this case, a std::tuple&lt;float, float, float=
&gt;. And this is what is moved into the function. Essentially it would be =
equate to something like:<br><br>auto&amp; coords { packedModelData[0], pac=
kedModelData[1], packedModelData[2] };<br>auto&amp; uvCoords { packedModelD=
ata[3], packedModelData[4] };<br><br>AddToBuffer(coords);<br>AddToBuffer(co=
ords);<br>AddToBuffer(coords);<br><br>AddToTextureBuffer(uvCoords);<br>AddT=
oTextureBuffer(uvCoords);<br>AddToTextureBuffer(uvCoords);<br></div></div>

<p></p>

-- <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+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/6e87c91d-9334-4558-b690-29816008f326%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/6e87c91d-9334-4558-b690-29816008f326=
%40isocpp.org</a>.<br />

------=_Part_1581_1051347228.1481625231896--

------=_Part_1580_1759392520.1481625231895--

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 13 Dec 2016 08:24:56 -0800 (PST)
Raw View
------=_Part_1883_188568241.1481646296480
Content-Type: multipart/alternative;
 boundary="----=_Part_1884_1411065662.1481646296481"

------=_Part_1884_1411065662.1481646296481
Content-Type: text/plain; charset=UTF-8

On Tuesday, December 13, 2016 at 4:40:50 AM UTC-5, Michael Davies wrote:
>
> On Monday, December 12, 2016 at 11:53:08 PM UTC, Nicol Bolas wrote:
>
>>
>> I'm not sure I understand your example here. In particular, why would
>> `AddToBuffer` take tuples? Why not have them be variadic functions? So you
>> call `AddToBuffer(x, y, z)`, which we already know how to do.
>>
>> I don't see a need for a language version of `make_tuple`. Or `zip`.
>> Library functionality seems reasonable enough.
>>
>
> This probably isn't the best example to be honest. But simply this would
> work to show more clear reasoning when separating the data into different
> sets. And could be used to reason a grouped object if there was any need
> for such a thing. Of course you could have them be variadic functions but
> you would lose meaning if you were just to look at the x, y, z by
> themselves. By having something akin to [x,y,z] you're saying "These
> variables should be grouped together as they are important to one another."
> A more prudent example may be if you wanted to create a scaled wirefrrame
> model. The u,v coordinates in that regard would be unimportant. So you may
> want to construct a new vector including only the relevant information. Or,
> you may(for some weird reason) want to transfer the UV coordinates to
> multiple models.
>
> std::vector<std::tuple<float, float, float>> scaledModel;
> std::vector<std::pair<float, float>> uvCoords;
>
> for(auto& [x,y,z][u,v] : packedModelData)
> {
>     scaledModel.push_back([x,y,z]);
>     uvCoords.push_back([u,v]);
> }
>
> Scale(&scaledModel, 2.0f);
> Draw(cube, uvCoords);
> Draw(sphere, uvCoords);
> Draw(pyramid, uvCoords);
>

Which is adequately done by this:

for(auto [x, y, z, u, v] : packedModelData)
{
    scaledModel.emplace_back(x,y,z);
    uvCoords.emplace_back(u,v);
}

And I'd argue that this is the preferred way to go.

But in any case, it's still not clear what exactly you're asking for.

For example, what does `auto& [x,y,z][u,v]` actually *do*? You have two
sets of structured bindings, but it's not clear what that actually means
for the generated code. Further, what does `[x, y, z]` actually mean? Are
you allowed to do `[x, y, u]`? Is `[x, y, z]` some kind of identifier or
something?

--
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/f69a38e9-5c66-43c8-b6d4-f4edaf1b4e59%40isocpp.org.

------=_Part_1884_1411065662.1481646296481
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tuesday, December 13, 2016 at 4:40:50 AM UTC-5, Michael=
 Davies wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
>On Monday, December 12, 2016 at 11:53:08 PM UTC, Nicol Bolas wrote:<br><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><br>I&#39;m not =
sure I understand your example here. In particular, why would `AddToBuffer`=
 take tuples? Why not have them be variadic functions? So you call `AddToBu=
ffer(x, y, z)`, which we already know how to do.<br><br>I don&#39;t see a n=
eed for a language version of `make_tuple`. Or `zip`. Library functionality=
 seems reasonable enough.<br></div></div></blockquote><div><br>This probabl=
y isn&#39;t the best example to be honest. But simply this would work to sh=
ow more clear reasoning when separating the data into different sets. And c=
ould be used to reason a grouped object if there was any need for such a th=
ing. Of course you could have them be variadic functions but you would lose=
 meaning if you were just to look at the x, y, z by themselves. By having s=
omething akin to [x,y,z] you&#39;re saying &quot;These variables should be =
grouped together as they are important to one another.&quot; A more prudent=
 example may be if you wanted to create a scaled wirefrrame model. The u,v =
coordinates in that regard would be unimportant. So you may want to constru=
ct a new vector including only the relevant information. Or, you may(for so=
me weird reason) want to transfer the UV coordinates to multiple models.<br=
><br><div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,1=
87,187);border-style:solid;border-width:1px"><code><div><span style=3D"colo=
r:#000">std</span><span style=3D"color:#660">::</span><span style=3D"color:=
#000">vector</span><span style=3D"color:#660">&lt;</span><span style=3D"col=
or:#000">std</span><span style=3D"color:#660">::</span><span style=3D"color=
:#000">tuple</span><span style=3D"color:#660">&lt;</span><span style=3D"col=
or:#008">float</span><span style=3D"color:#660">,</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#008">float</span><span style=3D"color=
:#660">,</span><span style=3D"color:#000"> </span><span style=3D"color:#008=
">float</span><span style=3D"color:#660">&gt;&gt;</span><span style=3D"colo=
r:#000"> scaledModel</span><span style=3D"color:#660">;</span><span style=
=3D"color:#000"><br>std</span><span style=3D"color:#660">::</span><span sty=
le=3D"color:#000">vector</span><span style=3D"color:#660">&lt;</span><span =
style=3D"color:#000">std</span><span style=3D"color:#660">::</span><span st=
yle=3D"color:#000">pair</span><span style=3D"color:#660">&lt;</span><span s=
tyle=3D"color:#008">float</span><span style=3D"color:#660">,</span><span st=
yle=3D"color:#000"> </span><span style=3D"color:#008">float</span><span sty=
le=3D"color:#660">&gt;&gt;</span><span style=3D"color:#000"> uvCoords</span=
><span style=3D"color:#660">;</span><span style=3D"color:#000"><br><br></sp=
an><span style=3D"color:#008">for</span><span style=3D"color:#660">(</span>=
<span style=3D"color:#008">auto</span><span style=3D"color:#660">&amp;</spa=
n><span style=3D"color:#000"> </span><span style=3D"color:#660">[</span><sp=
an style=3D"color:#000">x</span><span style=3D"color:#660">,</span><span st=
yle=3D"color:#000">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">u</span><span style=3D"color:#660">,</span><span style=3D"color=
:#000">v</span><span style=3D"color:#660">]</span><span style=3D"color:#000=
"> </span><span style=3D"color:#660">:</span><span style=3D"color:#000"> pa=
ckedModelData</span><span style=3D"color:#660">)</span><span style=3D"color=
:#000"><br></span><span style=3D"color:#660">{</span><span style=3D"color:#=
000"><br>=C2=A0 =C2=A0 scaledModel</span><span style=3D"color:#660">.</span=
><span style=3D"color:#000">push_back</span><span style=3D"color:#660">([</=
span><span style=3D"color:#000">x</span><span style=3D"color:#660">,</span>=
<span style=3D"color:#000">y</span><span style=3D"color:#660">,</span><span=
 style=3D"color:#000">z</span><span style=3D"color:#660">])<wbr>;</span><sp=
an style=3D"color:#000"><br>=C2=A0 =C2=A0 uvCoords</span><span style=3D"col=
or:#660">.</span><span style=3D"color:#000">push_back</span><span style=3D"=
color:#660">([</span><span style=3D"color:#000">u</span><span style=3D"colo=
r:#660">,</span><span style=3D"color:#000">v</span><span style=3D"color:#66=
0">]);</span><span style=3D"color:#000"><br></span><span style=3D"color:#66=
0">}</span><span style=3D"color:#000"><br><br></span><span style=3D"color:#=
606">Scale</span><span style=3D"color:#660">(&amp;</span><span style=3D"col=
or:#000">scaledModel</span><span style=3D"color:#660">,</span><span style=
=3D"color:#000"> </span><span style=3D"color:#066">2.0f</span><span style=
=3D"color:#660">);</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#606">Draw</span><span style=3D"color:#660">(</span><span style=
=3D"color:#000">cube</span><span style=3D"color:#660">,</span><span style=
=3D"color:#000"> uvCoords</span><span style=3D"color:#660">);</span><span s=
tyle=3D"color:#000"></span><br><code><span style=3D"color:#606">Draw</span>=
<span style=3D"color:#660">(</span><span style=3D"color:#660"></span></code=
><code><span style=3D"color:#660"><code><span style=3D"color:#000">sphere</=
span></code>,</span><span style=3D"color:#000"> uvCoords</span><span style=
=3D"color:#660">);</span><span style=3D"color:#000"></span></code><br><code=
><code><span style=3D"color:#606">Draw</span><span style=3D"color:#660">(</=
span></code><code><span style=3D"color:#660"><code><span style=3D"color:#00=
0"></span></code></span></code></code><code><code><span style=3D"color:#660=
"><code><code><span style=3D"color:#660"><code><span style=3D"color:#000">p=
yramid</span></code></span></code></code>,</span><span style=3D"color:#000"=
> uvCoords</span><span style=3D"color:#660">);</span><span style=3D"color:#=
000"><br></span></code></code></div></code></div></div></div></blockquote><=
div><br>Which is adequately done by this:<br><br><div style=3D"background-c=
olor: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: s=
olid; border-width: 1px; overflow-wrap: break-word;" class=3D"prettyprint">=
<code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">for</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" class=3D"s=
tyled-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 st=
yle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> z</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> u</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> v</span><span style=3D"color: #660;" class=3D"styled-by-prettify">]=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> packedModelData</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 scaledModel</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">emplace_back</span><span style=3D"co=
lor: #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"style=
d-by-prettify">y</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify">z</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 uv=
Coords</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify">emplace_back<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">u</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">v</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">}</span></div></code></div><br>And I&#39;d argue that this i=
s the preferred way to go.<br><br>But in any case, it&#39;s still not clear=
 what exactly you&#39;re asking for.<br><br>For example, what does `auto&am=
p; [x,y,z][u,v]` actually <i>do</i>? You have two sets of structured bindin=
gs, but it&#39;s not clear what that actually means for the generated code.=
 Further, what does `[x, y, z]` actually mean? Are you allowed to do `[x, y=
, u]`? Is `[x, y, z]` some kind of identifier or something?<br></div></div>

<p></p>

-- <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+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/f69a38e9-5c66-43c8-b6d4-f4edaf1b4e59%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/f69a38e9-5c66-43c8-b6d4-f4edaf1b4e59=
%40isocpp.org</a>.<br />

------=_Part_1884_1411065662.1481646296481--

------=_Part_1883_188568241.1481646296480--

.