Topic: Multi-Range For Loop
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Tue, 11 Aug 2015 02:28:53 -0700 (PDT)
Raw View
------=_Part_4646_495283625.1439285333827
Content-Type: multipart/alternative;
boundary="----=_Part_4647_173438136.1439285333828"
------=_Part_4647_173438136.1439285333828
Content-Type: text/plain; charset=UTF-8
I have recently come across some legacy code that I am trying to update to
the latest standards and STL.
In doing so I have come across something that I feel is missing from the
current standard and I believe would be quite easy to add to the standard.
When working with STL style containers we can iterate over every item in a
single container, however we are currently unable (without external
libraries) to iterate over multiple containers.
For example:
given 2 or more equally sized containers (in my case 2 vectors of strings)
I want to iterate both and call an external function with both dereferenced
values (i.e. passing http headers off to underlying API or class).
my options are:
1)
auto iter1 = vec_str1.begin();
auto iter2 = vec_str2.begin();
while (iter1 != vec_str1.end() && iter2 != vec_str2.end())
{
http_client.add_header(*iter1, *iter2);
++iter1;
++iter2;
}
2)
for (auto iter1 = vec_str1.begin(), iter2 = vec_str2.begin(); iter1 !=
vec_str1.end() && iter2 != vec_str2.end(); ++iter1, ++iter2)
{
http_client.add_header(*iter1, *iter2);
}
3) using boost
template<class... Conts>
auto zip_range(Conts&... conts) -> decltype(boost::make_iterator_range(
boost::make_zip_iterator(boost::make_tuple(conts.begin()...)),
boost::make_zip_iterator(boost::make_tuple(conts.end()...))
))
{
return {
boost::make_zip_iterator(boost::make_tuple(conts.begin()...)),
boost::make_zip_iterator(boost::make_tuple(conts.end()...))
};
}
for(auto&& t : zip_range(vec_str1, vec_str2))
{
http_client.add_header(t.get<0>(), t.get<1>());
}
All of these to me seem like a lot of work, and are not particularly
intuitive.
I wonder if it would be much more elegant and expressive to be able to
write the following:
for (auto header_name, header_value : vec_str1, vec_str2)
{
http_client.add_header(header_name, header_value);
}
This could collapse the comma delimited definitions into a tuple that would
allow incrementing all the iterators together.
This would then also map the dereferenced tuple iterators into the defined
names.
I am just wondering what the community might think about this?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_4647_173438136.1439285333828
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I have recently come across some legacy code that I am try=
ing to update to the latest standards and STL.<br>In doing so I have come a=
cross something that I feel is missing from the current standard and I beli=
eve would be quite easy to add to the standard.<br><br>When working with ST=
L style containers we can iterate over every item in a single container, ho=
wever we are currently unable (without external libraries) to iterate over =
multiple containers.<br><br>For example:<br><br>given 2 or more equally siz=
ed containers (in my case 2 vectors of strings)<br>I want to iterate both a=
nd call an external function with both dereferenced values (i.e. passing ht=
tp headers off to underlying API or class).<br><br>my options are:<br><br>1=
)<br><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 25=
0); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1p=
x; word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpre=
ttyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> iter1 </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> vec_str1</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">begin</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: #008;" class=
=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> iter2 </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> vec_str2</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">.</span><span style=3D"color: #008;" class=3D"styled-by-prettify">be=
gin</span><span style=3D"color: #660;" class=3D"styled-by-prettify">();</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><sp=
an style=3D"color: #008;" class=3D"styled-by-prettify">while</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">iter1 </span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">!=3D</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> vec_str1</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">.</span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">end</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">()</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&&=
;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> iter2 </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">!=3D</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> vec_str2</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">end</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">())</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 http_client</span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">add_header</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">(*</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify">iter1</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: #660;" class=3D"styled-by-prettify">*</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify">iter2</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">++</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">iter1</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">++</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify">iter2</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">}</span></div></code></div><br>2)<br><div class=3D"pret=
typrint" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(1=
87, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-wor=
d;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #008;" class=3D"styled-by-prettify">for</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </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: #000;" class=3D"st=
yled-by-prettify"> iter1 </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> vec_str1</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">.</span><span style=3D"color: #008;" class=3D"styled-by-prettify">be=
gin</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(),</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> iter2 </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> vec_str2</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">begin</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">();</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> iter1 </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">!=3D</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> vec_str1</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">.</span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">end</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">()</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">&&</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> iter2 </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">!=3D</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> vec_str2</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">end</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: #660;" class=3D"s=
tyled-by-prettify">++</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify">iter1</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><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">iter2</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 http_client</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">add_header</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">(*</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify">iter1</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">*</span><span style=3D"color: #000;" class=3D"styled-by-prettify">it=
er2</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><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">}</span></div></code>=
</div><br>3) using boost<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 class=3D"prettyprin=
t"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styl=
ed-by-prettify">template</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify"><</span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">class</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">...</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #606;" class=3D"styled-by-prettify">Conts</span><=
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: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> zip_range</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #606=
;" class=3D"styled-by-prettify">Conts</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">&...</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> conts</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">-></span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">decltype</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify">boost</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify">make_iterator_range</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 boo=
st</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">make_zip_iterato=
r</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">boost</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify">make_tuple</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">conts</span><span style=3D"color: #660;"=
class=3D"styled-by-prettify">.</span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">begin</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">()...)),</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 boost</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify">make_zip_iterator</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify">boost</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">make_tuple</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">conts</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">.</span><span style=3D"color: #008;" class=3D"styled-by-prettify">end</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">()...))</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">))</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=
=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">return=
</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"><br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 boost</span><span style=3D"color: #660;" class=3D"styled-by-prettify">:=
:</span><span style=3D"color: #000;" class=3D"styled-by-prettify">make_zip_=
iterator</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify">boost</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify">make_tuple</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify">conts</span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #008;" c=
lass=3D"styled-by-prettify">begin</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 =C2=A0 =C2=A0 boost</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">make_zip_iterator</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">boost</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">make_tuple</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">conts</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">.</span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">end</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-pretti=
fy">};</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><br></span><spa=
n 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">&&</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> t </span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> zip_range</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">vec_str1</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> vec=
_str2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">))</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><s=
pan 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 http_clien=
t</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">add_header</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">t</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #008;"=
class=3D"styled-by-prettify">get</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify"><</span><span style=3D"color: #066;" class=3D"st=
yled-by-prettify">0</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">>(),</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> t</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.<=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">get</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify"><</span><span s=
tyle=3D"color: #066;" class=3D"styled-by-prettify">1</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">>());</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">}</span></div></code></div><br>All of the=
se to me seem like a lot of work, and are not particularly intuitive.<br><b=
r><br>I wonder if it would be much more elegant and expressive to be able t=
o write the following:<br><br><div class=3D"prettyprint" style=3D"backgroun=
d-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style=
: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"prettypr=
int"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">for</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> header_name<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> header_value </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> vec_str1</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> vec_str2</span><span style=3D"colo=
r: #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"style=
d-by-prettify"><br>=C2=A0 =C2=A0 http_client</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify">add_header</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">header_name</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> header_value</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">);</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</=
span></div></code></div><br>This could collapse the comma delimited definit=
ions into a tuple that would allow incrementing all the iterators together.=
<br>This would then also map the dereferenced tuple iterators into the defi=
ned names.<br><br>I am just wondering what the community might think about =
this?<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_4647_173438136.1439285333828--
------=_Part_4646_495283625.1439285333827--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Tue, 11 Aug 2015 12:44:48 +0300
Raw View
On 11 August 2015 at 12:28, Izzy Coding <matthew.i.greenwood@gmail.com> wrote:
> I wonder if it would be much more elegant and expressive to be able to write
> the following:
> for (auto header_name, header_value : vec_str1, vec_str2)
> {
> http_client.add_header(header_name, header_value);
> }
> This could collapse the comma delimited definitions into a tuple that would
> allow incrementing all the iterators together.
> This would then also map the dereferenced tuple iterators into the defined
> names.
> I am just wondering what the community might think about this?
See http://cplusplus.github.io/EWG/ewg-active.html#43. So, this has been
suggested all the way to the committee, but we haven't seen an actual proposal
for it yet.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Tue, 11 Aug 2015 03:05:09 -0700 (PDT)
Raw View
------=_Part_115_103926547.1439287509609
Content-Type: multipart/alternative;
boundary="----=_Part_116_1770177726.1439287509609"
------=_Part_116_1770177726.1439287509609
Content-Type: text/plain; charset=UTF-8
Great stuff.
Wonder if any paper has been done on this yet?
Would be good to get involved in this as it would make a lot of my legacy
code so much simpler.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_116_1770177726.1439287509609
Content-Type: text/html; charset=UTF-8
<div dir="ltr">Great stuff.<br><br>Wonder if any paper has been done on this yet?<br>Would be good to get involved in this as it would make a lot of my legacy code so much simpler.<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />
------=_Part_116_1770177726.1439287509609--
------=_Part_115_103926547.1439287509609--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Tue, 11 Aug 2015 13:31:01 +0300
Raw View
On 11 August 2015 at 13:05, Izzy Coding <matthew.i.greenwood@gmail.com> wrote:
> Great stuff.
> Wonder if any paper has been done on this yet?
No. As I said, there hasn't been a proposal for it.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: David Krauss <potswa@gmail.com>
Date: Tue, 11 Aug 2015 18:13:43 +0800
Raw View
--Apple-Mail=_5E9D799E-4203-45C1-9629-DEB82A43121B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
> On 2015=E2=80=9308=E2=80=9311, at 5:28 PM, Izzy Coding <matthew.i.greenwo=
od@gmail.com> wrote:
>=20
> for(auto&& t : zip_range(vec_str1, vec_str2))
> {
> http_client.add_header(t.get<0>(), t.get<1>());
> }
This isn=E2=80=99t so bad, given the zip_range facility. (Since there=E2=80=
=99s nothing else we can zip, perhaps std::zip would be a good enough name.=
)
Calling get is ugly but that=E2=80=99s the =E2=80=9Cmultiple return value=
=E2=80=9D problem which should be solved more generally. Hmm, I have an ide=
a about that=E2=80=A6 will start another thread.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--Apple-Mail=_5E9D799E-4203-45C1-9629-DEB82A43121B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9308=
=E2=80=9311, at 5:28 PM, Izzy Coding <<a href=3D"mailto:matthew.i.greenw=
ood@gmail.com" class=3D"">matthew.i.greenwood@gmail.com</a>> wrote:</div=
><br class=3D"Apple-interchange-newline"><div class=3D""><span class=3D"sty=
led-by-prettify" style=3D"font-family: monospace; font-size: 12px; font-sty=
le: normal; font-variant: normal; font-weight: normal; letter-spacing: norm=
al; line-height: normal; orphans: auto; text-align: start; text-indent: 0px=
; text-transform: none; white-space: normal; widows: auto; word-spacing: 0p=
x; -webkit-text-stroke-width: 0px; color: rgb(0, 0, 136);">for</span><span =
class=3D"styled-by-prettify" style=3D"font-family: monospace; font-size: 12=
px; font-style: normal; font-variant: normal; font-weight: normal; letter-s=
pacing: normal; line-height: normal; orphans: auto; text-align: start; text=
-indent: 0px; text-transform: none; white-space: normal; widows: auto; word=
-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(102, 102, 0);">(<=
/span><span class=3D"styled-by-prettify" style=3D"font-family: monospace; f=
ont-size: 12px; font-style: normal; font-variant: normal; font-weight: norm=
al; letter-spacing: normal; line-height: normal; orphans: auto; text-align:=
start; text-indent: 0px; text-transform: none; white-space: normal; widows=
: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(0, 0,=
136);">auto</span><span class=3D"styled-by-prettify" style=3D"font-family:=
monospace; font-size: 12px; font-style: normal; font-variant: normal; font=
-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto=
; text-align: start; text-indent: 0px; text-transform: none; white-space: n=
ormal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; col=
or: rgb(102, 102, 0);">&&</span><span class=3D"styled-by-prettify" =
style=3D"font-family: monospace; font-size: 12px; font-style: normal; font-=
variant: normal; font-weight: normal; letter-spacing: normal; line-height: =
normal; orphans: auto; text-align: start; text-indent: 0px; text-transform:=
none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-s=
troke-width: 0px;"><span class=3D"Apple-converted-space"> </span>t<spa=
n class=3D"Apple-converted-space"> </span></span><span class=3D"styled=
-by-prettify" style=3D"font-family: monospace; font-size: 12px; font-style:=
normal; font-variant: normal; font-weight: normal; letter-spacing: normal;=
line-height: normal; orphans: auto; text-align: start; text-indent: 0px; t=
ext-transform: none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; color: rgb(102, 102, 0);">:</span><span cla=
ss=3D"styled-by-prettify" style=3D"font-family: monospace; font-size: 12px;=
font-style: normal; font-variant: normal; font-weight: normal; letter-spac=
ing: normal; line-height: normal; orphans: auto; text-align: start; text-in=
dent: 0px; text-transform: none; white-space: normal; widows: auto; word-sp=
acing: 0px; -webkit-text-stroke-width: 0px;"><span class=3D"Apple-converted=
-space"> </span>zip_range</span><span class=3D"styled-by-prettify" sty=
le=3D"font-family: monospace; font-size: 12px; font-style: normal; font-var=
iant: normal; font-weight: normal; letter-spacing: normal; line-height: nor=
mal; orphans: auto; text-align: start; text-indent: 0px; text-transform: no=
ne; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stro=
ke-width: 0px; color: rgb(102, 102, 0);">(</span><span class=3D"styled-by-p=
rettify" style=3D"font-family: monospace; font-size: 12px; font-style: norm=
al; font-variant: normal; font-weight: normal; letter-spacing: normal; line=
-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-t=
ransform: none; white-space: normal; widows: auto; word-spacing: 0px; -webk=
it-text-stroke-width: 0px;">vec_str1</span><span class=3D"styled-by-prettif=
y" style=3D"font-family: monospace; font-size: 12px; font-style: normal; fo=
nt-variant: normal; font-weight: normal; letter-spacing: normal; line-heigh=
t: normal; orphans: auto; text-align: start; text-indent: 0px; text-transfo=
rm: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-tex=
t-stroke-width: 0px; color: rgb(102, 102, 0);">,</span><span class=3D"style=
d-by-prettify" style=3D"font-family: monospace; font-size: 12px; font-style=
: normal; font-variant: normal; font-weight: normal; letter-spacing: normal=
; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;=
-webkit-text-stroke-width: 0px;"><span class=3D"Apple-converted-space">&nb=
sp;</span>vec_str2</span><span class=3D"styled-by-prettify" style=3D"font-f=
amily: monospace; font-size: 12px; font-style: normal; font-variant: normal=
; font-weight: normal; letter-spacing: normal; line-height: normal; orphans=
: auto; text-align: start; text-indent: 0px; text-transform: none; white-sp=
ace: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0p=
x; color: rgb(102, 102, 0);">))</span><span class=3D"styled-by-prettify" st=
yle=3D"font-family: monospace; font-size: 12px; font-style: normal; font-va=
riant: normal; font-weight: normal; letter-spacing: normal; line-height: no=
rmal; orphans: auto; text-align: start; text-indent: 0px; text-transform: n=
one; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-str=
oke-width: 0px;"><br class=3D""></span><span class=3D"styled-by-prettify" s=
tyle=3D"font-family: monospace; font-size: 12px; font-style: normal; font-v=
ariant: normal; font-weight: normal; letter-spacing: normal; line-height: n=
ormal; orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-st=
roke-width: 0px; color: rgb(102, 102, 0);">{</span><span class=3D"styled-by=
-prettify" style=3D"font-family: monospace; font-size: 12px; font-style: no=
rmal; font-variant: normal; font-weight: normal; letter-spacing: normal; li=
ne-height: normal; orphans: auto; text-align: start; text-indent: 0px; text=
-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -we=
bkit-text-stroke-width: 0px;"><br class=3D""> http_client</spa=
n><span class=3D"styled-by-prettify" style=3D"font-family: monospace; font-=
size: 12px; font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: auto; text-align: sta=
rt; text-indent: 0px; text-transform: none; white-space: normal; widows: au=
to; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(102, 102,=
0);">.</span><span class=3D"styled-by-prettify" style=3D"font-family: mono=
space; font-size: 12px; font-style: normal; font-variant: normal; font-weig=
ht: normal; letter-spacing: normal; line-height: normal; orphans: auto; tex=
t-align: start; text-indent: 0px; text-transform: none; white-space: normal=
; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">add_hea=
der</span><span class=3D"styled-by-prettify" style=3D"font-family: monospac=
e; font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; orphans: auto; text-al=
ign: start; text-indent: 0px; text-transform: none; white-space: normal; wi=
dows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(1=
02, 102, 0);">(</span><span class=3D"styled-by-prettify" style=3D"font-fami=
ly: monospace; font-size: 12px; font-style: normal; font-variant: normal; f=
ont-weight: normal; letter-spacing: normal; line-height: normal; orphans: a=
uto; text-align: start; text-indent: 0px; text-transform: none; white-space=
: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"=
>t</span><span class=3D"styled-by-prettify" style=3D"font-family: monospace=
; font-size: 12px; font-style: normal; font-variant: normal; font-weight: n=
ormal; letter-spacing: normal; line-height: normal; orphans: auto; text-ali=
gn: start; text-indent: 0px; text-transform: none; white-space: normal; wid=
ows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(10=
2, 102, 0);">.</span><span class=3D"styled-by-prettify" style=3D"font-famil=
y: monospace; font-size: 12px; font-style: normal; font-variant: normal; fo=
nt-weight: normal; letter-spacing: normal; line-height: normal; orphans: au=
to; text-align: start; text-indent: 0px; text-transform: none; white-space:=
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; c=
olor: rgb(0, 0, 136);">get</span><span class=3D"styled-by-prettify" style=
=3D"font-family: monospace; font-size: 12px; font-style: normal; font-varia=
nt: normal; font-weight: normal; letter-spacing: normal; line-height: norma=
l; orphans: auto; text-align: start; text-indent: 0px; text-transform: none=
; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke=
-width: 0px; color: rgb(102, 102, 0);"><</span><span class=3D"styled-by-=
prettify" style=3D"font-family: monospace; font-size: 12px; font-style: nor=
mal; font-variant: normal; font-weight: normal; letter-spacing: normal; lin=
e-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-=
transform: none; white-space: normal; widows: auto; word-spacing: 0px; -web=
kit-text-stroke-width: 0px; color: rgb(0, 102, 102);">0</span><span class=
=3D"styled-by-prettify" style=3D"font-family: monospace; font-size: 12px; f=
ont-style: normal; font-variant: normal; font-weight: normal; letter-spacin=
g: normal; line-height: normal; orphans: auto; text-align: start; text-inde=
nt: 0px; text-transform: none; white-space: normal; widows: auto; word-spac=
ing: 0px; -webkit-text-stroke-width: 0px; color: rgb(102, 102, 0);">>(),=
</span><span class=3D"styled-by-prettify" style=3D"font-family: monospace; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: nor=
mal; letter-spacing: normal; line-height: normal; orphans: auto; text-align=
: start; text-indent: 0px; text-transform: none; white-space: normal; widow=
s: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class=3D=
"Apple-converted-space"> </span>t</span><span class=3D"styled-by-prett=
ify" style=3D"font-family: monospace; font-size: 12px; font-style: normal; =
font-variant: normal; font-weight: normal; letter-spacing: normal; line-hei=
ght: normal; orphans: auto; text-align: start; text-indent: 0px; text-trans=
form: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-t=
ext-stroke-width: 0px; color: rgb(102, 102, 0);">.</span><span class=3D"sty=
led-by-prettify" style=3D"font-family: monospace; font-size: 12px; font-sty=
le: normal; font-variant: normal; font-weight: normal; letter-spacing: norm=
al; line-height: normal; orphans: auto; text-align: start; text-indent: 0px=
; text-transform: none; white-space: normal; widows: auto; word-spacing: 0p=
x; -webkit-text-stroke-width: 0px; color: rgb(0, 0, 136);">get</span><span =
class=3D"styled-by-prettify" style=3D"font-family: monospace; font-size: 12=
px; font-style: normal; font-variant: normal; font-weight: normal; letter-s=
pacing: normal; line-height: normal; orphans: auto; text-align: start; text=
-indent: 0px; text-transform: none; white-space: normal; widows: auto; word=
-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(102, 102, 0);">&l=
t;</span><span class=3D"styled-by-prettify" style=3D"font-family: monospace=
; font-size: 12px; font-style: normal; font-variant: normal; font-weight: n=
ormal; letter-spacing: normal; line-height: normal; orphans: auto; text-ali=
gn: start; text-indent: 0px; text-transform: none; white-space: normal; wid=
ows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; color: rgb(0,=
102, 102);">1</span><span class=3D"styled-by-prettify" style=3D"font-famil=
y: monospace; font-size: 12px; font-style: normal; font-variant: normal; fo=
nt-weight: normal; letter-spacing: normal; line-height: normal; orphans: au=
to; text-align: start; text-indent: 0px; text-transform: none; white-space:=
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; c=
olor: rgb(102, 102, 0);">>());</span><span class=3D"styled-by-prettify" =
style=3D"font-family: monospace; font-size: 12px; font-style: normal; font-=
variant: normal; font-weight: normal; letter-spacing: normal; line-height: =
normal; orphans: auto; text-align: start; text-indent: 0px; text-transform:=
none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-s=
troke-width: 0px;"><br class=3D""></span><span class=3D"styled-by-prettify"=
style=3D"font-family: monospace; font-size: 12px; font-style: normal; font=
-variant: normal; font-weight: normal; letter-spacing: normal; line-height:=
normal; orphans: auto; text-align: start; text-indent: 0px; text-transform=
: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-=
stroke-width: 0px; color: rgb(102, 102, 0);">}</span><br class=3D"Apple-int=
erchange-newline"></div></blockquote></div><br class=3D""><div class=3D"">T=
his isn=E2=80=99t so bad, given the <font face=3D"Courier" class=3D"">zip_r=
ange</font> facility. (Since there=E2=80=99s nothing else we can zip, perha=
ps <font face=3D"Courier" class=3D"">std::zip</font> would be a good enough=
name.)</div><div class=3D""><br class=3D""></div><div class=3D"">Calling <=
font face=3D"Courier" class=3D"">get</font> is ugly but that=E2=80=99s the =
=E2=80=9Cmultiple return value=E2=80=9D problem which should be solved more=
generally. Hmm, I have an idea about that=E2=80=A6 will start another thre=
ad.</div><div class=3D""><br class=3D""></div></body></html>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--Apple-Mail=_5E9D799E-4203-45C1-9629-DEB82A43121B--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Tue, 11 Aug 2015 15:01:20 -0700 (PDT)
Raw View
------=_Part_1980_771823144.1439330481140
Content-Type: text/plain; charset=UTF-8
Granted the boost option is not too bad given the required boilerplate but it does rather hide the identity of what the returned values are.
I have written up a quick draft proposal for this. Any feedback would be greatly appreciated.
https://drive.google.com/open?id=0B26UZ0CbMay5V25ZZUFXZDlILXM
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_1980_771823144.1439330481140--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Wed, 12 Aug 2015 01:03:36 +0300
Raw View
On 12 August 2015 at 01:01, Izzy Coding <matthew.i.greenwood@gmail.com> wrote:
> Granted the boost option is not too bad given the required boilerplate but it does rather hide the identity of what the returned values are.
>
> I have written up a quick draft proposal for this. Any feedback would be greatly appreciated.
> https://drive.google.com/open?id=0B26UZ0CbMay5V25ZZUFXZDlILXM
Any particular reason why you're suggesting a syntax different from
the one suggested
in EWG 43?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Tue, 11 Aug 2015 15:15:04 -0700 (PDT)
Raw View
------=_Part_6151_697293956.1439331304351
Content-Type: text/plain; charset=UTF-8
The one suggested in EWG to me seems a little less friendly when reading the code to determine what the loop body is doing. In most C++ code I write I always declare all before defining them.
E.G.
for ( var1 = x, var2 = 2; var1 <= var2; ++var1) { ... }
So to follow the same flow I wrote it as is.
I do not mind changing it if the masses prefer the other syntax.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_6151_697293956.1439331304351--
.
Author: Richard Smith <richard@metafoo.co.uk>
Date: Tue, 11 Aug 2015 15:32:48 -0700
Raw View
--001a1133efca84bbed051d10aed3
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Tue, Aug 11, 2015 at 3:13 AM, David Krauss <potswa@gmail.com> wrote:
>
> On 2015=E2=80=9308=E2=80=9311, at 5:28 PM, Izzy Coding <matthew.i.greenwo=
od@gmail.com>
> wrote:
>
> for(auto&& t : zip_range(vec_str1, vec_str2))
> {
> http_client.add_header(t.get<0>(), t.get<1>());
> }
>
>
> This isn=E2=80=99t so bad, given the zip_range facility. (Since there=E2=
=80=99s nothing
> else we can zip, perhaps std::zip would be a good enough name.)
>
> Calling get is ugly but that=E2=80=99s the =E2=80=9Cmultiple return value=
=E2=80=9D problem which
> should be solved more generally. Hmm, I have an idea about that=E2=80=A6 =
will start
> another thread.
>
I agree: I'd rather see us fix the general problem of naming multiple
return values / destructuring initialization than add a special syntax for
zip iteration. (Of course, we don't have to choose between these and could
have both.)
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--001a1133efca84bbed051d10aed3
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 T=
ue, Aug 11, 2015 at 3:13 AM, David Krauss <span dir=3D"ltr"><<a href=3D"=
mailto:potswa@gmail.com" target=3D"_blank">potswa@gmail.com</a>></span> =
wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div style=3D"word-wrap:break-word=
"><span class=3D""><br><div><blockquote type=3D"cite"><div>On 2015=E2=80=93=
08=E2=80=9311, at 5:28 PM, Izzy Coding <<a href=3D"mailto:matthew.i.gree=
nwood@gmail.com" target=3D"_blank">matthew.i.greenwood@gmail.com</a>> wr=
ote:</div><br><div><span style=3D"font-family:monospace;font-size:12px;font=
-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;=
line-height:normal;text-align:start;text-indent:0px;text-transform:none;whi=
te-space:normal;word-spacing:0px;color:rgb(0,0,136)">for</span><span style=
=3D"font-family:monospace;font-size:12px;font-style:normal;font-variant:nor=
mal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:=
start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0=
px;color:rgb(102,102,0)">(</span><span style=3D"font-family:monospace;font-=
size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-s=
pacing:normal;line-height:normal;text-align:start;text-indent:0px;text-tran=
sform:none;white-space:normal;word-spacing:0px;color:rgb(0,0,136)">auto</sp=
an><span style=3D"font-family:monospace;font-size:12px;font-style:normal;fo=
nt-variant:normal;font-weight:normal;letter-spacing:normal;line-height:norm=
al;text-align:start;text-indent:0px;text-transform:none;white-space:normal;=
word-spacing:0px;color:rgb(102,102,0)">&&</span><span style=3D"font=
-family:monospace;font-size:12px;font-style:normal;font-variant:normal;font=
-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;te=
xt-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><spa=
n>=C2=A0</span>t<span>=C2=A0</span></span><span style=3D"font-family:monosp=
ace;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal=
;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;=
text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,0=
)">:</span><span style=3D"font-family:monospace;font-size:12px;font-style:n=
ormal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-hei=
ght:normal;text-align:start;text-indent:0px;text-transform:none;white-space=
:normal;word-spacing:0px"><span>=C2=A0</span>zip_range</span><span style=3D=
"font-family:monospace;font-size:12px;font-style:normal;font-variant:normal=
;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:sta=
rt;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;=
color:rgb(102,102,0)">(</span><span style=3D"font-family:monospace;font-siz=
e:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spac=
ing:normal;line-height:normal;text-align:start;text-indent:0px;text-transfo=
rm:none;white-space:normal;word-spacing:0px">vec_str1</span><span style=3D"=
font-family:monospace;font-size:12px;font-style:normal;font-variant:normal;=
font-weight:normal;letter-spacing:normal;line-height:normal;text-align:star=
t;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;c=
olor:rgb(102,102,0)">,</span><span style=3D"font-family:monospace;font-size=
:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spaci=
ng:normal;line-height:normal;text-align:start;text-indent:0px;text-transfor=
m:none;white-space:normal;word-spacing:0px"><span>=C2=A0</span>vec_str2</sp=
an><span style=3D"font-family:monospace;font-size:12px;font-style:normal;fo=
nt-variant:normal;font-weight:normal;letter-spacing:normal;line-height:norm=
al;text-align:start;text-indent:0px;text-transform:none;white-space:normal;=
word-spacing:0px;color:rgb(102,102,0)">))</span><span style=3D"font-family:=
monospace;font-size:12px;font-style:normal;font-variant:normal;font-weight:=
normal;letter-spacing:normal;line-height:normal;text-align:start;text-inden=
t:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></span><=
span style=3D"font-family:monospace;font-size:12px;font-style:normal;font-v=
ariant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;t=
ext-align:start;text-indent:0px;text-transform:none;white-space:normal;word=
-spacing:0px;color:rgb(102,102,0)">{</span><span style=3D"font-family:monos=
pace;font-size:12px;font-style:normal;font-variant:normal;font-weight:norma=
l;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px=
;text-transform:none;white-space:normal;word-spacing:0px"><br>=C2=A0 =C2=A0=
http_client</span><span style=3D"font-family:monospace;font-size:12px;font=
-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;=
line-height:normal;text-align:start;text-indent:0px;text-transform:none;whi=
te-space:normal;word-spacing:0px;color:rgb(102,102,0)">.</span><span style=
=3D"font-family:monospace;font-size:12px;font-style:normal;font-variant:nor=
mal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:=
start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0=
px">add_header</span><span style=3D"font-family:monospace;font-size:12px;fo=
nt-style:normal;font-variant:normal;font-weight:normal;letter-spacing:norma=
l;line-height:normal;text-align:start;text-indent:0px;text-transform:none;w=
hite-space:normal;word-spacing:0px;color:rgb(102,102,0)">(</span><span styl=
e=3D"font-family:monospace;font-size:12px;font-style:normal;font-variant:no=
rmal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align=
:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:=
0px">t</span><span style=3D"font-family:monospace;font-size:12px;font-style=
:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-h=
eight:normal;text-align:start;text-indent:0px;text-transform:none;white-spa=
ce:normal;word-spacing:0px;color:rgb(102,102,0)">.</span><span style=3D"fon=
t-family:monospace;font-size:12px;font-style:normal;font-variant:normal;fon=
t-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;t=
ext-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;colo=
r:rgb(0,0,136)">get</span><span style=3D"font-family:monospace;font-size:12=
px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:=
normal;line-height:normal;text-align:start;text-indent:0px;text-transform:n=
one;white-space:normal;word-spacing:0px;color:rgb(102,102,0)"><</span><s=
pan style=3D"font-family:monospace;font-size:12px;font-style:normal;font-va=
riant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;te=
xt-align:start;text-indent:0px;text-transform:none;white-space:normal;word-=
spacing:0px;color:rgb(0,102,102)">0</span><span style=3D"font-family:monosp=
ace;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal=
;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;=
text-transform:none;white-space:normal;word-spacing:0px;color:rgb(102,102,0=
)">>(),</span><span style=3D"font-family:monospace;font-size:12px;font-s=
tyle:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;li=
ne-height:normal;text-align:start;text-indent:0px;text-transform:none;white=
-space:normal;word-spacing:0px"><span>=C2=A0</span>t</span><span style=3D"f=
ont-family:monospace;font-size:12px;font-style:normal;font-variant:normal;f=
ont-weight:normal;letter-spacing:normal;line-height:normal;text-align:start=
;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;co=
lor:rgb(102,102,0)">.</span><span style=3D"font-family:monospace;font-size:=
12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacin=
g:normal;line-height:normal;text-align:start;text-indent:0px;text-transform=
:none;white-space:normal;word-spacing:0px;color:rgb(0,0,136)">get</span><sp=
an style=3D"font-family:monospace;font-size:12px;font-style:normal;font-var=
iant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;tex=
t-align:start;text-indent:0px;text-transform:none;white-space:normal;word-s=
pacing:0px;color:rgb(102,102,0)"><</span><span style=3D"font-family:mono=
space;font-size:12px;font-style:normal;font-variant:normal;font-weight:norm=
al;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0p=
x;text-transform:none;white-space:normal;word-spacing:0px;color:rgb(0,102,1=
02)">1</span><span style=3D"font-family:monospace;font-size:12px;font-style=
:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-h=
eight:normal;text-align:start;text-indent:0px;text-transform:none;white-spa=
ce:normal;word-spacing:0px;color:rgb(102,102,0)">>());</span><span style=
=3D"font-family:monospace;font-size:12px;font-style:normal;font-variant:nor=
mal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:=
start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0=
px"><br></span><span style=3D"font-family:monospace;font-size:12px;font-sty=
le:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line=
-height:normal;text-align:start;text-indent:0px;text-transform:none;white-s=
pace:normal;word-spacing:0px;color:rgb(102,102,0)">}</span><br></div></bloc=
kquote></div><br></span><div>This isn=E2=80=99t so bad, given the <font fac=
e=3D"Courier">zip_range</font> facility. (Since there=E2=80=99s nothing els=
e we can zip, perhaps <font face=3D"Courier">std::zip</font> would be a goo=
d enough name.)</div><div><br></div><div>Calling <font face=3D"Courier">get=
</font> is ugly but that=E2=80=99s the =E2=80=9Cmultiple return value=E2=80=
=9D problem which should be solved more generally. Hmm, I have an idea abou=
t that=E2=80=A6 will start another thread.</div></div></blockquote><div><br=
></div><div>I agree: I'd rather see us fix the general problem of namin=
g multiple return values / destructuring initialization than add a special =
syntax for zip iteration. (Of course, we don't have to choose between t=
hese and could have both.)<br></div></div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a1133efca84bbed051d10aed3--
.
Author: "T. C." <rs2740@gmail.com>
Date: Tue, 11 Aug 2015 15:38:51 -0700 (PDT)
Raw View
------=_Part_5925_383388542.1439332731578
Content-Type: multipart/alternative;
boundary="----=_Part_5926_1502175366.1439332731578"
------=_Part_5926_1502175366.1439332731578
Content-Type: text/plain; charset=UTF-8
On Tuesday, August 11, 2015 at 6:15:04 PM UTC-4, Izzy Coding wrote:
>
> The one suggested in EWG to me seems a little less friendly when reading
> the code to determine what the loop body is doing. In most C++ code I write
> I always declare all before defining them.
>
> E.G.
> for ( var1 = x, var2 = 2; var1 <= var2; ++var1) { ... }
>
> So to follow the same flow I wrote it as is.
> I do not mind changing it if the masses prefer the other syntax.
>
I'm not sure I understand the argument.
var1 = x, var2 = 2 maps quite well to var1 : vector1; var2 : vector2.
Also, the comma operator can currently be used in the range initializer,
and your proposal doesn't handle it.
Finally, the current rules is that auto x = f(), y = g(); must deduce the
same type for x and y. Your syntax would either make the behavior
inconsistent, or unnecessarily constrain it (can only iterate over ranges
with the same value type).
for (auto& x : v; auto& y : w) avoids all of these problems, and is more
expressive because you can do, say, for(auto& x : v; const auto& y : w).
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_5926_1502175366.1439332731578
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>On Tuesday, August 11, 2015 at 6:15:04 PM UTC-4, Izzy =
Coding wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">The one suggested=
in EWG to me seems a little less friendly when reading the code to determi=
ne what the loop body is doing. In most C++ code I write I always declare a=
ll before defining them.<p>E.G.<br>for ( var1 =3D x, var2 =3D 2; var1 <=
=3D var2; ++var1) { ... }</p><p>So to follow the same flow I wrote it as is=
..<br>I do not mind changing it if the masses prefer the other syntax.</p></=
blockquote><div><br></div>I'm not sure I understand the argument.<div><=
br></div><div>var1 =3D x, var2 =3D 2 maps quite well to var1 : vector1; var=
2 : vector2.</div><div>=C2=A0<br></div><div>Also, the comma operator can cu=
rrently be used in the range initializer, and your proposal doesn't han=
dle it.</div><div><br></div><div>Finally, the current rules is that auto x =
=3D f(), y =3D g(); must deduce the same type for x and y. Your syntax woul=
d either=C2=A0make the behavior inconsistent, or unnecessarily constrain it=
(can only iterate over ranges with the same value type).</div><div><br></d=
iv><div><span style=3D"color: rgb(0, 0, 0);">for (auto& x : v; auto&=
; y : w) avoids all of these problems, and is more expressive because you c=
an do, say, for(auto& x : v; const auto& y : w).</span></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_5926_1502175366.1439332731578--
------=_Part_5925_383388542.1439332731578--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Wed, 12 Aug 2015 00:00:12 -0700 (PDT)
Raw View
------=_Part_6361_63712881.1439362812482
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
In regards to the mapping I have always viewed the : to essentially be the =
"in" definition. As such I see it as essentially equivalent to the ; of the=
legacy for statement, which defines the iteration requirements.
for ( declaration ; iteration requirement; iteration action )...
compared to:
for ( declarations : iteration requirements and actions ) ...
As I mentioned before I am not tied to any particular syntax and would be h=
appy to change. I just feel that the way I have defined it is easier to rea=
son about the loop content given a long list of containers.
About the issue of the single auto&& in the declaration. This is just my si=
mple way of writing it as this is a quick draft. I would indeed expect it t=
o be more similar to:
for ( auto&& var1, auto&& var2 : con1, cont2 ) { ... }
Which would then allow for multiple different types in the declaration list=
.. Unfortunately I am not a standardese pro and as such I more than likely h=
ave something wrong in my draft proposal.
In regards to the unpacking of multiple values to improve the boost::zip_it=
erator version of the code, I wonder if then we are suggestions that the zi=
p_iterator or something similar should also be introduced into the standard=
? Also I would like to see what the ideas are around how the multiple retur=
n value stuff would affect this idea? Could someone provide an example of w=
hat using the multiple return value for statement would look like?
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_6361_63712881.1439362812482--
.
Author: Andrey Semashev <andrey.semashev@gmail.com>
Date: Wed, 12 Aug 2015 10:43:25 +0300
Raw View
On Wed, Aug 12, 2015 at 10:00 AM, Izzy Coding
<matthew.i.greenwood@gmail.com> wrote:
> In regards to the mapping I have always viewed the : to essentially be th=
e "in" definition. As such I see it as essentially equivalent to the ; of t=
he legacy for statement, which defines the iteration requirements.
>
> for ( declaration ; iteration requirement; iteration action )...
>
> compared to:
>
> for ( declarations : iteration requirements and actions ) ...
>
> As I mentioned before I am not tied to any particular syntax and would be=
happy to change. I just feel that the way I have defined it is easier to r=
eason about the loop content given a long list of containers.
>
> About the issue of the single auto&& in the declaration. This is just my =
simple way of writing it as this is a quick draft. I would indeed expect it=
to be more similar to:
>
> for ( auto&& var1, auto&& var2 : con1, cont2 ) { ... }
To me, this syntax is slightly confusing. It looks like it might
iterate over permutations of the containers. Also, what is the
behavior if the containers have different sizes?
Personally, I like the zip solution most because it makes clear what
is being iterated over. But besides zip, I like the EWG proposed
syntax more because the element variable declarations are
syntactically close to the related ranges; with that syntax it is
easier to add or remove ranges to iterate over.
> Which would then allow for multiple different types in the declaration li=
st. Unfortunately I am not a standardese pro and as such I more than likely=
have something wrong in my draft proposal.
>
> In regards to the unpacking of multiple values to improve the boost::zip_=
iterator version of the code, I wonder if then we are suggestions that the =
zip_iterator or something similar should also be introduced into the standa=
rd? Also I would like to see what the ideas are around how the multiple ret=
urn value stuff would affect this idea? Could someone provide an example of=
what using the multiple return value for statement would look like?
I think most of Boost.Iterator and Boost.Range would be a good
addition to the standard library.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Wed, 12 Aug 2015 01:12:03 -0700 (PDT)
Raw View
------=_Part_4990_962926087.1439367124052
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I see your points with regards to syntax style.
I will amend the proposal to use EWG 43 syntax. Just thinking about it I th=
ink the standard changes might even be simpler with that syntax as it will =
just be a change to the existing range-based for statement rather than a ne=
w syntax form.
With regards to what if the containers are different in size, that is menti=
oned in my draft proposal. Basically the __end is equal the the first conta=
iner end reached. Therefore no out of range exceptions can occur.
With regards to preference of the zip_iterator version. My main bugbare is =
the required boilerplate code in order for it to work. If the new multi-ran=
ge-based for syntax could be used but essentially do the zip... Version stu=
ff under the covers then I would be happy with that. My only other issues a=
re those to do with clarity of the code.
for ( var1:cont1, ... )
UseVars(var9, var2, ...);
To me is much clearer and less prone to errors than:
for( auto&& t : zip_iterator( cont1, ... ) )
UseVars(t.get<9>(), t.get<2>(), ...);
Using the zip format it is difficult to know what each t.get refers to (I d=
o understand that this is essentially the multiple value return idea, but t=
hat also then to me seems like it could bloat the declarations in the for s=
tatement). I am however not against that also being possible in the standar=
d, but feel a clearer syntax would be better than depending on library iter=
ator adapters and tuple style multiple return values. To me it is just much=
more clear and precise and easy to reason about.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_4990_962926087.1439367124052--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Wed, 12 Aug 2015 02:49:37 -0700 (PDT)
Raw View
------=_Part_6683_272625439.1439372977581
Content-Type: text/plain; charset=UTF-8
Here is a quick updated version of my draft proposal.
I hope this sits better with the original idea. Not sure if my wording is anywhere near clear as I am not a standardese person.
https://drive.google.com/open?id=0B26UZ0CbMay5cXpRSmtqd09YR00
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_6683_272625439.1439372977581--
.
Author: "T. C." <rs2740@gmail.com>
Date: Wed, 12 Aug 2015 10:51:14 -0700 (PDT)
Raw View
------=_Part_6551_875820052.1439401874980
Content-Type: multipart/alternative;
boundary="----=_Part_6552_1025321805.1439401874980"
------=_Part_6552_1025321805.1439401874980
Content-Type: text/plain; charset=UTF-8
On Wednesday, August 12, 2015 at 5:49:37 AM UTC-4, Izzy Coding wrote:
>
> Here is a quick updated version of my draft proposal.
> I hope this sits better with the original idea. Not sure if my wording is
> anywhere near clear as I am not a standardese person.
>
> https://drive.google.com/open?id=0B26UZ0CbMay5cXpRSmtqd09YR00
>
The wording needs a lot of work, but that's sort of expected.
I'd still argue that the x : v pairs should be separated by semicolons,
not commas. Otherwise you need to constrain the initializer to disallow
comma operators, and introduce a breaking change along the way.
for-range-statement:
> for-range-statement-list , ...
I don't understand this production at all. What are you trying to do here?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_6552_1025321805.1439401874980
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Wednesday, August 12, 2015 at 5:49:37 AM UTC-4,=
Izzy Coding wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Here is a q=
uick updated version of my draft proposal.<br>I hope this sits better with =
the original idea. Not sure if my wording is anywhere near clear as I am no=
t a standardese person.<p><a href=3D"https://drive.google.com/open?id=3D0B2=
6UZ0CbMay5cXpRSmtqd09YR00" target=3D"_blank" rel=3D"nofollow" onmousedown=
=3D"this.href=3D'https://drive.google.com/open?id\0750B26UZ0CbMay5cXpRS=
mtqd09YR00';return true;" onclick=3D"this.href=3D'https://drive.goo=
gle.com/open?id\0750B26UZ0CbMay5cXpRSmtqd09YR00';return true;">https://=
drive.google.com/open?<wbr>id=3D<wbr>0B26UZ0CbMay5cXpRSmtqd09YR00</a></p></=
blockquote><div><br></div><div>The wording needs a lot of work, but that=
9;s sort of expected.</div><div><br></div><div>=C2=A0I'd still argue th=
at the x : v pairs should be separated by semicolons, not commas. Otherwise=
you need to constrain the initializer to disallow comma operators, and int=
roduce a breaking change along the way.</div><div><br></div><div><blockquot=
e class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; border-left-wid=
th: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; p=
adding-left: 1ex;">for-range-statement:=C2=A0<br>=C2=A0for-range-statement-=
list , ...</blockquote><div><br></div><div>I don't understand this prod=
uction at all. What are you trying to do here?</div></div><div><br></div></=
div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_6552_1025321805.1439401874980--
------=_Part_6551_875820052.1439401874980--
.
Author: "T. C." <rs2740@gmail.com>
Date: Wed, 12 Aug 2015 11:00:19 -0700 (PDT)
Raw View
------=_Part_2318_981662477.1439402419851
Content-Type: multipart/alternative;
boundary="----=_Part_2319_91854798.1439402419851"
------=_Part_2319_91854798.1439402419851
Content-Type: text/plain; charset=UTF-8
On Wednesday, August 12, 2015 at 5:49:37 AM UTC-4, Izzy Coding wrote:
>
> Here is a quick updated version of my draft proposal.
> I hope this sits better with the original idea. Not sure if my wording is
> anywhere near clear as I am not a standardese person.
>
> https://drive.google.com/open?id=0B26UZ0CbMay5cXpRSmtqd09YR00
>
let the range-init be equivalent to a tuple-like structure containing the
> required range-init for each of the declarations of a for-range-pair-
> declaration.
> tuple{ (expression1), ..., (expression{n}) };
This will have potential lifetime issues, and you didn't specify what this
tuple-like structure contains - references? values?
I think trying to pack them is the wrong way to go. Just define auto&&
__range1 through __rangeN. Ditto for __begin and __end.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_2319_91854798.1439402419851
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br>On Wednesday, August 12, 2015 at 5:49:37 AM UTC-4, Izzy Coding wrot=
e:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;b=
order-left: 1px #ccc solid;padding-left: 1ex;">Here is a quick updated vers=
ion of my draft proposal.<br>I hope this sits better with the original idea=
.. Not sure if my wording is anywhere near clear as I am not a standardese p=
erson.<p><a href=3D"https://drive.google.com/open?id=3D0B26UZ0CbMay5cXpRSmt=
qd09YR00" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D=
9;https://drive.google.com/open?id\0750B26UZ0CbMay5cXpRSmtqd09YR00';ret=
urn true;" onclick=3D"this.href=3D'https://drive.google.com/open?id\075=
0B26UZ0CbMay5cXpRSmtqd09YR00';return true;">https://drive.google.com/op=
en?<wbr>id=3D<wbr>0B26UZ0CbMay5cXpRSmtqd09YR00</a></p></blockquote><div><br=
></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex=
; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-lef=
t-style: solid; padding-left: 1ex;">let the range-init be equivalent to a t=
uple-like structure containing the<br>required range-init for each of the d=
eclarations of a for-range-pair-<br>declaration.=C2=A0<br>=C2=A0tuple{ (exp=
ression1), ..., (expression{n}) };=C2=A0</blockquote><div><br></div><div>Th=
is will have potential lifetime issues, and you didn't specify what thi=
s tuple-like structure contains - references? values?</div><div><br></div><=
div>I think trying to pack them is the wrong way to go. Just define auto&am=
p;& __range1 through __rangeN. Ditto for __begin and __end.</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_2319_91854798.1439402419851--
------=_Part_2318_981662477.1439402419851--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Wed, 12 Aug 2015 12:33:55 -0700 (PDT)
Raw View
------=_Part_767_1179642438.1439408035536
Content-Type: text/plain; charset=UTF-8
I agree, maybe the semi-colon would be a better separator to use.
The format "something , ..." Is what I thought denoted continuous optional additions. My intent is to make the list essentially variable in length.
Could you give an example of what you mean by defining auto&& __range1 through __rangeN? I am not sure how this could be written in standardese terms.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_767_1179642438.1439408035536--
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Wed, 12 Aug 2015 16:00:55 -0400
Raw View
On 2015-08-12 04:12, Izzy Coding wrote:
> With regards to preference of the zip_iterator version. [...] My only
> other issues are those to do with clarity of the code.
>
> for ( var1:cont1, ... )
> UseVars(var9, var2, ...);
>
> To me is much clearer and less prone to errors than:
>
> for( auto&& t : zip_iterator( cont1, ... ) )
> UseVars(t.get<9>(), t.get<2>(), ...);
....which is exactly why we need unpacking :-). (One of many reasons,
anyway.)
....or argument expansion:
for (auto&& iter : zip(cont1, ...))
call([*]iter);
(Requires that the argument order matches the order in the tuple, but in
this case you can do that by giving the containers in the correct order
to 'zip'. If we could slice tuples, that could be somewhat relaxed,
though the syntax would still be somewhat ugly.)
--
Matthew
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Wed, 12 Aug 2015 13:26:16 -0700 (PDT)
Raw View
------=_Part_7201_1992233627.1439411176655
Content-Type: multipart/alternative;
boundary="----=_Part_7202_1251961598.1439411176655"
------=_Part_7202_1251961598.1439411176655
Content-Type: text/plain; charset=UTF-8
On Wednesday, 12 August 2015 21:01:13 UTC+1, Matthew Woehlke wrote:
>
> On 2015-08-12 04:12, Izzy Coding wrote:
> > With regards to preference of the zip_iterator version. [...] My only
> > other issues are those to do with clarity of the code.
> >
> > for ( var1:cont1, ... )
> > UseVars(var9, var2, ...);
> >
> > To me is much clearer and less prone to errors than:
> >
> > for( auto&& t : zip_iterator( cont1, ... ) )
> > UseVars(t.get<9>(), t.get<2>(), ...);
>
> ...which is exactly why we need unpacking :-). (One of many reasons,
> anyway.)
>
> ...or argument expansion:
>
> for (auto&& iter : zip(cont1, ...))
> call([*]iter);
>
> (Requires that the argument order matches the order in the tuple, but in
> this case you can do that by giving the containers in the correct order
> to 'zip'. If we could slice tuples, that could be somewhat relaxed,
> though the syntax would still be somewhat ugly.)
>
> --
> Matthew
>
>
This implementation still depends on something external to the for
statement its self which to me is still a bit too dirty.
Unless something could be done to allow definition for the containers in
the same format. however, that I believe would also not look very intuative.
However with a simple change to the for statement syntax rules it could be
very simple and easily understood what a users intention is.
Also I would prefer not depending this idea on a library template class
meaning that it can not be modified due to the tight coupling to this
statement syntax.
Surely a dependancy like that would do more harm than good to the language?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_7202_1251961598.1439411176655
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wednesday, 12 August 2015 21:01:13 UTC+1, Matthew Woehlke wrote:<blockq=
uote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-lef=
t: 1px #ccc solid;padding-left: 1ex;">On 2015-08-12 04:12, Izzy Coding wrot=
e:
<br>> With regards to preference of the zip_iterator version. [...] My o=
nly
<br>> other issues are those to do with clarity of the code.
<br>>=20
<br>> for ( var1:cont1, ... )
<br>> =C2=A0 =C2=A0 UseVars(var9, var2, ...);
<br>>=20
<br>> To me is much clearer and less prone to errors than:
<br>>=20
<br>> for( auto&& t : zip_iterator( cont1, ... ) )
<br>> =C2=A0 =C2=A0 UseVars(t.get<9>(), t.get<2>(), ...);
<br>
<br>...which is exactly why we need unpacking :-). (One of many reasons,
<br>anyway.)
<br>
<br>...or argument expansion:
<br>
<br>=C2=A0 for (auto&& iter : zip(cont1, ...))
<br>=C2=A0 =C2=A0 call([*]iter);
<br>
<br>(Requires that the argument order matches the order in the tuple, but i=
n
<br>this case you can do that by giving the containers in the correct order
<br>to 'zip'. If we could slice tuples, that could be somewhat rela=
xed,
<br>though the syntax would still be somewhat ugly.)
<br>
<br>--=20
<br>Matthew
<br>
<br></blockquote><div><br>This implementation still depends on something ex=
ternal to the for statement its self which to me is still a bit too dirty.<=
br>Unless something could be done to allow definition for the containers in=
the same format. however, that I believe would also not look very intuativ=
e.<br>However with a simple change to the for statement syntax rules it cou=
ld be very simple and easily understood what a users intention is.<br>Also =
I would prefer not depending this idea on a library template class meaning =
that it can not be modified due to the tight coupling to this statement syn=
tax.<br>Surely a dependancy like that would do more harm than good to the l=
anguage? <br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_7202_1251961598.1439411176655--
------=_Part_7201_1992233627.1439411176655--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Sat, 15 Aug 2015 02:42:24 -0700 (PDT)
Raw View
------=_Part_1545_1260339723.1439631745151
Content-Type: text/plain; charset=UTF-8
Just been thinking. What if you have a range of tuples that you wish to map internally to separate variables? Also then if you have several ranges that you wish to iterate and unpack?
I would think the syntax defined in the draft proposal woul more easily allow this as well as being much more easy to understand and reason about.
for ( { auto&& item1, auto&& item2 } : tuple-range; auto&& single-value : container; { auto&& key1, auto&& value1 } : pair-range)
{
if (DoSomething(item1, item2, single-value))
{
DoSomethingElse(key1, value1);
}
}
How would something like this be expressed with only the multiple value return syntax?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_1545_1260339723.1439631745151--
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Mon, 17 Aug 2015 09:35:13 -0400
Raw View
On 2015-08-15 05:42, Izzy Coding wrote:
> Just been thinking. What if you have a range of tuples that you wish to map internally to separate variables?
Sounds like a good argument why we should have both :-).
Note: It wasn't my intention to be speaking against the proposal
(looking back, I can see where that wouldn't be clear), only to note
that unpacking at least makes the 'zip' form less ugly.
> How would something like this be expressed with only the multiple value return syntax?
Well, you *could* do it with a form of 'zip' that is aware that one or
more of its inputs should be unpacked first...
--
Matthew
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Fri, 21 Aug 2015 06:55:25 -0700 (PDT)
Raw View
------=_Part_4129_876371880.1440165325585
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
>Sounds like a good argument why we should have both :-).=20
>Note: It wasn't my intention to be speaking against the proposal=20
(looking back, I can see where that wouldn't be clear), only to note=20
that unpacking at least makes the 'zip' form less ugly.
I agree, having both options would be good and allow for developer preferen=
ce. In my proposal there would still be the possibility to add the multiple=
return syntax as part of the other proposal or an extension of.
I will be completing my amendements to my proposal and hopefully getting a =
document number too. I would be greatful for any comments / error correctio=
ns to what I have as I know my wording is not quite right. I would be willi=
ng to have any help to perfect this proposal, and maybe afterwards I could =
also look at a proposal to extend the existing multiple return syntax with =
relation to my proposal also. Again any help / comments are welcome as I wa=
nt to try and ensure the best possible fit for the proposal.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_4129_876371880.1440165325585--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Tue, 25 Aug 2015 05:38:58 -0700 (PDT)
Raw View
------=_Part_3437_1815759454.1440506338152
Content-Type: text/plain; charset=UTF-8
Does anyone know what the current proposal document number is for the multiple return value work?
I need to reference it in my new version of my proposal document.
Regards
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_3437_1815759454.1440506338152--
.
Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Tue, 25 Aug 2015 14:43:07 +0200
Raw View
2015-08-25 14:38 GMT+02:00 Izzy Coding <matthew.i.greenwood@gmail.com>:
> Does anyone know what the current proposal document number is for the multiple return value work?
> I need to reference it in my new version of my proposal document.
You will a document number assigned when submitting to the lwgchair
address. I guess you are talking about "Multi-Range for loops", right?
From my recent feedback you should notice that the document number
will be P0026. In any case: Please always refer with such questions to
the lwgchair address.
Thanks,
- Daniel
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Tue, 25 Aug 2015 06:58:01 -0700 (PDT)
Raw View
------=_Part_30_1512711974.1440511082006
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
What I meant was for the "multiple return value" problem mentioned by David=
Krouss in this thread. I am not sure if there is any current proposal for =
this but I am just ensuring my proposal could work along side it enabling t=
he use of both as has been discussed in this thread before.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_30_1512711974.1440511082006--
.
Author: David Krauss <potswa@gmail.com>
Date: Wed, 26 Aug 2015 08:35:09 +0800
Raw View
> On 2015=E2=80=9308=E2=80=9325, at 9:58 PM, Izzy Coding <matthew.i.greenwo=
od@gmail.com> wrote:
>=20
> What I meant was for the "multiple return value" problem mentioned by Dav=
id Krouss in this thread. I am not sure if there is any current proposal fo=
r this but I am just ensuring my proposal could work along side it enabling=
the use of both as has been discussed in this thread before.
I=E2=80=99m not aware of any current proposal either. There=E2=80=99s just =
been a lot of discussion on this mailing list.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Wed, 26 Aug 2015 06:44:34 -0700 (PDT)
Raw View
------=_Part_361_751416761.1440596674348
Content-Type: text/plain; charset=UTF-8
Great stuff, for now I have just mentioned that my proposal should allow for those discussions to be a potential proposal, however that it is currently out-of-scope for this proposal, but should allow for its possible addition in future revisions.
Current Draft Proposal Version:
https://drive.google.com/open?id=0B26UZ0CbMay5OGRORzkzZ1BiVWs
I hope it is much clearer than before. Any changes and amendments are welcome.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_361_751416761.1440596674348--
.
Author: "T. C." <rs2740@gmail.com>
Date: Thu, 27 Aug 2015 02:56:35 -0700 (PDT)
Raw View
------=_Part_5490_2113618316.1440669395929
Content-Type: multipart/alternative;
boundary="----=_Part_5491_672837119.1440669395930"
------=_Part_5491_672837119.1440669395930
Content-Type: text/plain; charset=UTF-8
From the motivation section:
3) Using legacy for loop with boost::zip_iterator
That example is using a range-based for loop.
Also with option 3 as I see it, there is a possibility for undefined
> behaviour if the for loop body modifies the ranges used. This is due to
> explicitly having stored each ranges end() iterator, which could
> potentially become an invalidated iterator on addition/removal of items
> from the container.
That's not being fixed by this proposal; the end() iterators are still
obtained once and stored. I'd omit it.
Design decisions:
the subsequent dereferenced iterator is then assigned to the declared
> variable for use within the for statement body.
It's an initialization, not an assignment. Better be precise.
the __end of iteration should at the point of hitting the first of any
> range ends
No need for double underscore here.
> However, when compiling with high warning levels it would be useful when
> possible to have a compiler warning about such mismatched ranges.
I don't see how that's possible. Whether there's a length mismatch is a
runtime property.
Technical Specifications:
auto&& __range-declaration-N = *__beginN;
>
That's incorrect. It should be
for-range-declaration-N = *__beginN;
for-range-declaration already includes whatever the user specified.
for ( auto __begin = begin-expr, __end = end-expr; iterator-continuation-
> comparison; ++__begin )
>
__begin and __end need to be moved outside the for loop header. The
iterators for different ranges are not necessarily of the same type.
Perhaps change range_init to (possibly rename to something like
range-and-iter-init)
auto&& __rangeN = ( expression ) /* or braced-init-list */ ;
auto __beginN = begin_exprN, __endN = end_exprN;
It might be worth mentioning the change made by the ranges proposal should
be incorporated - which uses instead
auto __beginN = begin_exprN;
auto __endN = end_exprN;
The difference being that this allows __beginN and __endN to have different
types.
++__begin is wrong. It needs to be (void)++__begin1, (void) ++ __begin2,
...., (void) ++__beginN.
This makes me wonder if it would be simpler to specify the behavior using a
while loop instead. At least you don't need the (void) casts.
if any of the comparisons return a false result then the expression as a
> whole should be false and iteration should stop
That's obvious from the expression. At best it's a note. I'd just delete it.
The final section still references __range, __begin, and __end, which can
be confusing and should be changed.
Also, N is being used as a placeholder for any value in range in some
places, and to refer to a particular value corresponding to the number
of for-range-pair-declaration's in other places. I'd use different letters.
On Wednesday, August 26, 2015 at 9:44:34 AM UTC-4, Izzy Coding wrote:
>
> Great stuff, for now I have just mentioned that my proposal should allow
> for those discussions to be a potential proposal, however that it is
> currently out-of-scope for this proposal, but should allow for its possible
> addition in future revisions.
>
> Current Draft Proposal Version:
> https://drive.google.com/open?id=0B26UZ0CbMay5OGRORzkzZ1BiVWs
>
> I hope it is much clearer than before. Any changes and amendments are
> welcome.
>
>
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_5491_672837119.1440669395930
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div style=3D"font-family: arial, sans-serif; font-si=
ze: small;">From the motivation section:</div><div style=3D"font-family: ar=
ial, sans-serif; font-size: small;"><br></div><blockquote style=3D"margin: =
0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204,=
204); border-left-style: solid; padding-left: 1ex;" class=3D"gmail_quote">=
3) Using legacy for loop with boost::zip_iterator</blockquote><div style=3D=
"font-family: arial, sans-serif; font-size: small;"><br></div><div style=3D=
"font-family: arial, sans-serif; font-size: small;">That example is using a=
range-based for loop.<br></div><div style=3D"font-family: arial, sans-seri=
f; font-size: small;"><br></div><blockquote class=3D"gmail_quote" style=3D"=
margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(2=
04, 204, 204); border-left-style: solid; padding-left: 1ex;">Also with opti=
on 3 as I see it, there is a possibility for undefined behaviour if the for=
loop body modifies the ranges used. This is due to explicitly having store=
d each ranges end() iterator, which could potentially become an invalidated=
iterator on addition/removal of items from the container.</blockquote></di=
v><div><br></div><div>That's not being fixed by this proposal; the end(=
) iterators are still obtained once and stored. I'd omit it.</div><div>=
<br></div><div>Design decisions:</div><div><br></div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; bor=
der-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left:=
1ex;">the subsequent dereferenced iterator is
then assigned to the declared variable for use within the for statement bod=
y.</blockquote><div>=C2=A0</div><div>It's an initialization, not an ass=
ignment. Better be precise.</div><div><br></div><blockquote class=3D"gmail_=
quote" style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-l=
eft-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;=
">=C2=A0the __end of
iteration should at the point of hitting the first of any range ends</block=
quote><div>=C2=A0</div><div>No need for double underscore here.</div><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px =
0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); borde=
r-left-style: solid; padding-left: 1ex;">However, when compiling with high =
warning levels it would be useful when
possible to have a compiler warning about such mismatched ranges.</blockquo=
te><div><br></div><div>I don't see how that's possible. Whether the=
re's a length mismatch is a runtime property.</div><div><br></div><div>=
Technical Specifications:</div><div><br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-lef=
t-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">=
<div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); w=
ord-wrap: break-word; background-color: rgb(250, 250, 250);"><code class=3D=
"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">auto</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">&&</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> __range</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">-</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">declaration</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">-</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">N </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
style=3D"color: #660;" class=3D"styled-by-prettify">*</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify">__beginN</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br></span></div></code></div></blockquote=
><div><br></div><div>That's incorrect. It should be</div><div><br></div=
><div><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 1=
87); word-wrap: break-word; background-color: rgb(250, 250, 250);"><code cl=
ass=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">for</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">-</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify">range</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">-</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y">declaration</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">-</span><span style=3D"color: #000;" class=3D"styled-by-prettify">N </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">*</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">__beginN</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">;</span></div></code></div><br></div><d=
iv>for-range-declaration already includes whatever the user specified.</div=
><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px =
0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); b=
order-left-style: solid; padding-left: 1ex;"><div class=3D"prettyprint" sty=
le=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; backgrou=
nd-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"su=
bprettyprint"><span style=3D"color: #000;" class=3D"styled-by-prettify">=C2=
=A0</span><span style=3D"color: #008;" class=3D"styled-by-prettify">for</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> __begin </span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">begin</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">-</span><span style=3D"color: #000;" class=3D"styled-by-prettify">exp=
r</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> __end </span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">end</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">-</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">expr</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> iterator</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">-</span><span style=3D"color: #000;" class=3D"styled-by-prettify">c=
ontinuation</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>-</span><span style=3D"color: #000;" class=3D"styled-by-prettify">comparis=
on</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">++</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify">__begin </span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"> </span></div></code></div></blockquote><div>=
<br></div><div>__begin and __end need to be moved outside the for loop head=
er. The iterators for different ranges are not necessarily of the same type=
..</div><div><br></div><div>Perhaps change range_init to (possibly rename to=
something like range-and-iter-init)</div><div><br></div><div class=3D"pret=
typrint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-wo=
rd; background-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><div=
class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">auto</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&&</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> __rangeN </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify"> expression </span><sp=
an 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=
: #800;" class=3D"styled-by-prettify">/* or braced-init-list */</span><span=
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> __beginN </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> begin_exprN</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> __endN </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> end_exprN</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></sp=
an></div></code></div><div><br></div><div>It might be worth mentioning the =
change made by the ranges proposal should be incorporated - which uses inst=
ead</div><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187=
, 187); word-wrap: break-word; background-color: rgb(250, 250, 250);"><code=
class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: =
#008;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"> __beginN </span><span style=3D"color: #660;"=
class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> begin_exprN</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">auto</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> __endN </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> end=
_exprN</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</s=
pan></div></code></div><div><br></div><div>The difference being that this a=
llows __beginN and __endN to have different types.</div><div><br></div><div=
><span class=3D"styled-by-prettify" style=3D"font-family: monospace; color:=
rgb(102, 102, 0); background-color: rgb(250, 250, 250);">++</span><span cl=
ass=3D"styled-by-prettify" style=3D"font-family: monospace; color: rgb(0, 0=
, 0); background-color: rgb(250, 250, 250);">__begin</span>=C2=A0<span styl=
e=3D"font-family: Arial, Helvetica, sans-serif; background-color: white;">i=
s wrong. It needs to be=C2=A0</span><span class=3D"styled-by-prettify" styl=
e=3D"font-family: monospace; color: rgb(102, 102, 0); background-color: rgb=
(250, 250, 250);">(</span><span class=3D"styled-by-prettify" style=3D"font-=
family: monospace; color: rgb(0, 0, 136); background-color: rgb(250, 250, 2=
50);">void</span><span class=3D"styled-by-prettify" style=3D"font-family: m=
onospace; color: rgb(102, 102, 0); background-color: rgb(250, 250, 250);">)=
++</span><span class=3D"styled-by-prettify" style=3D"font-family: monospace=
; color: rgb(0, 0, 0); background-color: rgb(250, 250, 250);">__begin1</spa=
n><span class=3D"styled-by-prettify" style=3D"font-family: monospace; color=
: rgb(102, 102, 0); background-color: rgb(250, 250, 250);">,</span><span cl=
ass=3D"styled-by-prettify" style=3D"font-family: monospace; color: rgb(0, 0=
, 0); background-color: rgb(250, 250, 250);">=C2=A0</span><span class=3D"st=
yled-by-prettify" style=3D"font-family: monospace; color: rgb(102, 102, 0);=
background-color: rgb(250, 250, 250);">(</span><span class=3D"styled-by-pr=
ettify" style=3D"font-family: monospace; color: rgb(0, 0, 136); background-=
color: rgb(250, 250, 250);">void</span><span class=3D"styled-by-prettify" s=
tyle=3D"font-family: monospace; color: rgb(102, 102, 0); background-color: =
rgb(250, 250, 250);">)</span><span class=3D"styled-by-prettify" style=3D"fo=
nt-family: monospace; color: rgb(0, 0, 0); background-color: rgb(250, 250, =
250);">=C2=A0</span><span class=3D"styled-by-prettify" style=3D"font-family=
: monospace; color: rgb(102, 102, 0); background-color: rgb(250, 250, 250);=
">++</span><span class=3D"styled-by-prettify" style=3D"font-family: monospa=
ce; color: rgb(0, 0, 0); background-color: rgb(250, 250, 250);">=C2=A0__beg=
in2</span><span class=3D"styled-by-prettify" style=3D"font-family: monospac=
e; color: rgb(102, 102, 0); background-color: rgb(250, 250, 250);">,</span>=
<span class=3D"styled-by-prettify" style=3D"font-family: monospace; color: =
rgb(0, 0, 0); background-color: rgb(250, 250, 250);">=C2=A0</span><span cla=
ss=3D"styled-by-prettify" style=3D"font-family: monospace; color: rgb(102, =
102, 0); background-color: rgb(250, 250, 250);">...,</span><span class=3D"s=
tyled-by-prettify" style=3D"font-family: monospace; color: rgb(0, 0, 0); ba=
ckground-color: rgb(250, 250, 250);">=C2=A0</span><span class=3D"styled-by-=
prettify" style=3D"font-family: monospace; color: rgb(102, 102, 0); backgro=
und-color: rgb(250, 250, 250);">(</span><span class=3D"styled-by-prettify" =
style=3D"font-family: monospace; color: rgb(0, 0, 136); background-color: r=
gb(250, 250, 250);">void</span><span class=3D"styled-by-prettify" style=3D"=
font-family: monospace; color: rgb(102, 102, 0); background-color: rgb(250,=
250, 250);">)</span><span class=3D"styled-by-prettify" style=3D"font-famil=
y: monospace; color: rgb(0, 0, 0); background-color: rgb(250, 250, 250);">=
=C2=A0</span><span class=3D"styled-by-prettify" style=3D"font-family: monos=
pace; color: rgb(102, 102, 0); background-color: rgb(250, 250, 250);">++</s=
pan><span class=3D"styled-by-prettify" style=3D"font-family: monospace; col=
or: rgb(0, 0, 0); background-color: rgb(250, 250, 250);">__beginN</span>.</=
div><div>This makes me wonder if it would be simpler to specify the behavio=
r using a while loop instead. At least you don't need the (void) casts.=
</div><br><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.=
8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-=
left-style: solid; padding-left: 1ex;">if any of the comparisons return a f=
alse result then the expression as a
whole should be false and iteration should stop</blockquote><div><br></div>=
<div>That's obvious from the expression. At best it's a note. I'=
;d just delete it.</div><div><br></div><div>The final section still referen=
ces __range, __begin, and __end, which can be confusing and should be chang=
ed.</div><div><br></div><div>Also, N is being used as a placeholder for any=
value in range in some places, and to refer to a particular value correspo=
nding to the number of=C2=A0for-range-pair-declaration's in other place=
s. I'd use different letters.=C2=A0</div><div><br></div>On Wednesday, A=
ugust 26, 2015 at 9:44:34 AM UTC-4, Izzy Coding wrote:<blockquote class=3D"=
gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc so=
lid;padding-left: 1ex;">Great stuff, for now I have just mentioned that my =
proposal should allow for those discussions to be a potential proposal, how=
ever that it is currently out-of-scope for this proposal, but should allow =
for its possible addition in future revisions.<p>Current Draft Proposal Ver=
sion:<br><a href=3D"https://drive.google.com/open?id=3D0B26UZ0CbMay5OGRORzk=
zZ1BiVWs" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D=
9;https://drive.google.com/open?id\0750B26UZ0CbMay5OGRORzkzZ1BiVWs';ret=
urn true;" onclick=3D"this.href=3D'https://drive.google.com/open?id\075=
0B26UZ0CbMay5OGRORzkzZ1BiVWs';return true;">https://drive.google.com/op=
en?<wbr>id=3D<wbr>0B26UZ0CbMay5OGRORzkzZ1BiVWs</a></p><p>I hope it is much =
clearer than before. Any changes and amendments are welcome.</p><p></p></bl=
ockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_5491_672837119.1440669395930--
------=_Part_5490_2113618316.1440669395929--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Thu, 27 Aug 2015 04:09:38 -0700 (PDT)
Raw View
------=_Part_314_389068662.1440673778161
Content-Type: text/plain; charset=UTF-8
Agree with all changes. Am applying them now.
>It might be worth mentioning the change made by the ranges >proposal should be incorporated - which uses instead
>...
What is the document number for the ranges proposal so I can add a reference to this as suggested?
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_314_389068662.1440673778161--
.
Author: "T. C." <rs2740@gmail.com>
Date: Thu, 27 Aug 2015 09:37:34 -0700 (PDT)
Raw View
------=_Part_6048_1683744626.1440693454503
Content-Type: multipart/alternative;
boundary="----=_Part_6049_1743892871.1440693454503"
------=_Part_6049_1743892871.1440693454503
Content-Type: text/plain; charset=UTF-8
On Thursday, August 27, 2015 at 7:09:38 AM UTC-4, Izzy Coding wrote:
>
> Agree with all changes. Am applying them now.
>
> >It might be worth mentioning the change made by the ranges >proposal
> should be incorporated - which uses instead
> >...
>
> What is the document number for the ranges proposal so I can add a
> reference to this as suggested?
>
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4382.pdf
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_6049_1743892871.1440693454503
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Thursday, August 27, 2015 at 7:09:38 AM UTC-4, =
Izzy Coding wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Agree with a=
ll changes. Am applying them now.<p>>It might be worth mentioning the ch=
ange made by the ranges >proposal should be incorporated - which uses in=
stead<br>>...</p><p>What is the document number for the ranges proposal =
so I can add a reference to this as suggested?</p></blockquote><div><br></d=
iv><div>=C2=A0http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4382=
..pdf</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_6049_1743892871.1440693454503--
------=_Part_6048_1683744626.1440693454503--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Thu, 27 Aug 2015 12:16:44 -0700 (PDT)
Raw View
------=_Part_1316_916645608.1440703005035
Content-Type: text/plain; charset=UTF-8
Great thanks.
Newly updated version is here:
https://drive.google.com/open?id=0B26UZ0CbMay5NGFDV3hUQk9hbjA
I hope this is closer to what it should be.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_1316_916645608.1440703005035--
.
Author: "T. C." <rs2740@gmail.com>
Date: Thu, 27 Aug 2015 21:01:02 -0700 (PDT)
Raw View
------=_Part_119_384379678.1440734462338
Content-Type: multipart/alternative;
boundary="----=_Part_120_624799590.1440734462338"
------=_Part_120_624799590.1440734462338
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
As cute as=20
Note: this is an early draft. It=E2=80=99s known to be incomplete and incor=
rect,=20
> and it has lots of bad formatting.
=20
is, I don't think you'll find it in many proposals. It's also less cute=20
when you fixed the spelling and formatting :)
This proposal should also consider changes based on the current working=20
> paper for "Ranges" [N4382]=20
where the iterator initialization for begin and end iterators are defined=
=20
> separately as they could=20
potentially be of differing types
That feels a little strong. I'd go with something like "The specification=
=20
below also incorporates a small change proposed in N4382 that allows begin=
=20
and end iterators of different types." with a disclaimer that it's not=20
essential to the proposal and trivial to remove if desired. The main point=
=20
of the paper is multiple ranges, not sentinels. The latter is a minor=20
drive-by change.
range-and-iter-init needs semicolons. The original one didn't have it=20
because it's one declaration used as range-init;. Now that it's many=20
separate declarations, it needs its own semicolons.
A multi-range-based for statement=20
The rest of the specification section still calls it just "range-based=20
for". I'd just stick with that name.
where iterator-continuation-comparison is equivalent to comparing
__beginN to its respective __endN using the not equal comparison for each=
=20
of the ranges declared
__beginN !=3D __endN
I think you deleted too much. The && is important, and is not described in=
=20
this text.
and iteration-action is equivalent to incrementing __beginN for each of the=
=20
> ranges declared=20
=20
Likewise. That spot can only accommodate one expression, hence the comma=20
operator.
Minor nitpick: I assume you copied part of the spec from a working draft -=
=20
you have ligatures like =EF=AC=81 in "defined" and "unqualified", which is =
a bit=20
jarring with a monospace font. Compare: defined vs. de=EF=AC=81ned
On Thursday, August 27, 2015 at 3:16:45 PM UTC-4, Izzy Coding wrote:
>
> Great thanks.
>
> Newly updated version is here:
> https://drive.google.com/open?id=3D0B26UZ0CbMay5NGFDV3hUQk9hbjA
>
> I hope this is closer to what it should be.
>
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_120_624799590.1440734462338
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">As cute as=C2=A0<div><br><div><blockquote class=3D"gmail_q=
uote" style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-le=
ft-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"=
>Note: this is an early draft. It=E2=80=99s known to be incomplete and inco=
rrect, and it has lots of bad formatting.</blockquote><div>=C2=A0</div><div=
><div>is, I don't think you'll find it in many proposals. It's =
also less cute when you fixed the spelling and formatting :)</div><div><br>=
</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex;=
border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left=
-style: solid; padding-left: 1ex;">This proposal should also consider chang=
es based on the current working paper for
"Ranges" [N4382]=C2=A0</blockquote><blockquote class=3D"gmail_quo=
te" style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left=
-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">w=
here the iterator initialization for begin and end iterators are defined se=
parately
as they could=C2=A0</blockquote><blockquote class=3D"gmail_quote" style=3D"=
margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(2=
04, 204, 204); border-left-style: solid; padding-left: 1ex;"> potentially b=
e of differing types</blockquote><div><br></div><div>That feels a little st=
rong. I'd go with something like "The specification below also inc=
orporates a small change proposed in N4382 that allows begin and end iterat=
ors of different types." with a disclaimer that it's not essential=
to the proposal and trivial to remove if desired. The main point of the pa=
per is multiple ranges, not sentinels. The latter is a minor drive-by chang=
e.</div><div><br></div><div>range-and-iter-init needs semicolons. The origi=
nal one didn't have it because it's one declaration used as <font f=
ace=3D"courier new, monospace">range-init;</font>. Now that it's many s=
eparate declarations, it needs its own semicolons.</div><div><br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; border-le=
ft-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: so=
lid; padding-left: 1ex;">A multi-range-based for statement=C2=A0</blockquot=
e><div><br></div><div>The rest of the specification section still calls it =
just "range-based for". I'd just stick with that name.</div><=
div><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0p=
x 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); bor=
der-left-style: solid; padding-left: 1ex;">where iterator-continuation-comp=
arison is equivalent to comparing</blockquote><blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-lef=
t-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">=
__beginN to its respective __endN using the not equal comparison for each=
=C2=A0</blockquote><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0=
px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204)=
; border-left-style: solid; padding-left: 1ex;">
of the ranges declared</blockquote><blockquote class=3D"gmail_quote" style=
=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: r=
gb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">
__beginN !=3D __endN</blockquote><div><br></div><div>I think you deleted t=
oo much. The && is important, and is not described in this text.</d=
iv><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0p=
x 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204);=
border-left-style: solid; padding-left: 1ex;">and iteration-action is equi=
valent to incrementing __beginN for each of
the ranges declared=C2=A0</blockquote><div>=C2=A0</div><div>Likewise. That =
spot can only accommodate one expression, hence the comma operator.</div><d=
iv><br></div><div><span style=3D"color: rgb(37, 37, 37); font-family: sans-=
serif; font-size: 14px; line-height: 12.8000001907349px;">Minor nitpick: I =
assume you copied part of the spec from a working draft - you have ligature=
s like =EF=AC=81 in "defined"=C2=A0</span><span style=3D"color: r=
gb(37, 37, 37); font-family: sans-serif; font-size: 14px; line-height: 12.8=
000001907349px;">and "unqualified"</span><span style=3D"color: rg=
b(37, 37, 37); font-family: sans-serif; font-size: 14px; line-height: 12.80=
00001907349px;">, which is a bit jarring with a monospace font.=C2=A0</span=
><span style=3D"color: rgb(37, 37, 37); font-family: sans-serif; font-size:=
14px; line-height: 12.8000001907349px;">Compare:=C2=A0</span><font face=3D=
"courier new, monospace">defined vs. de=EF=AC=81ned</font></div><div><font =
face=3D"courier new, monospace"><br></font></div><div><br></div>On Thursday=
, August 27, 2015 at 3:16:45 PM UTC-4, Izzy Coding wrote:<blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;">Great thanks.<p>Newly updated version is here:<=
br><a href=3D"https://drive.google.com/open?id=3D0B26UZ0CbMay5NGFDV3hUQk9hb=
jA" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D'http=
s://drive.google.com/open?id\0750B26UZ0CbMay5NGFDV3hUQk9hbjA';return tr=
ue;" onclick=3D"this.href=3D'https://drive.google.com/open?id\0750B26UZ=
0CbMay5NGFDV3hUQk9hbjA';return true;">https://drive.google.com/open?<wb=
r>id=3D<wbr>0B26UZ0CbMay5NGFDV3hUQk9hbjA</a></p><p>I hope this is closer to=
what it should be.</p><p></p></blockquote></div></div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_120_624799590.1440734462338--
------=_Part_119_384379678.1440734462338--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Fri, 28 Aug 2015 02:28:51 -0700 (PDT)
Raw View
------=_Part_492_1598413391.1440754131342
Content-Type: text/plain; charset=UTF-8
Great stuff.
New version can be found here:
https://drive.google.com/open?id=0B26UZ0CbMay5RG5NRERxWlBFNG8
Hope I have not missed anything.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_492_1598413391.1440754131342--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Sat, 29 Aug 2015 00:00:45 +0200
Raw View
--001a11c340143420e9051e6637f9
Content-Type: text/plain; charset=UTF-8
I have read this version except the formal wording.
I think that there might be a part missing explaining why a library
solution, an algorithm, would not work as well as a language change.
Or maybe suggestions to add both language and library extension (in which
case another proposal would be refered to)
I mean: would it be possible to implement something like this?
for_each( range_a, range_b, range_c, []( A& a, B& b, C& c ) { ... } ); ?
or
for_each( parallel_iter{range_a, range_b, range_c}, []( A& a, B& b, C&
c ) { ... } ); // specialization
which would allow paramet:
for_each( parallel_iter_default_value{range_a, range_b, range_c}, [](
A& a, B& b, C& c ) { ... } ); // specialization
which would iterate for each value of any of the ranges even if there is no
values anymore in the other ranges,
and will provide value-initialized values to the callback for these missing
values instead of stopping as soon any range is finished.
I'm not suggesting to fully explore these suggestions, I would prefer the
proposed solution, but I think
something like this will be suggested as alternative, so providing
comparison might help the proposal.
On 28 August 2015 at 11:28, Izzy Coding <matthew.i.greenwood@gmail.com>
wrote:
> Great stuff.
>
> New version can be found here:
> https://drive.google.com/open?id=0B26UZ0CbMay5RG5NRERxWlBFNG8
>
> Hope I have not missed anything.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--001a11c340143420e9051e6637f9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I have read this version except the formal wording.<div><b=
r></div><div>I think that there might be a part missing explaining why a li=
brary solution, an algorithm, would not work as well as a language change.<=
/div><div>Or maybe suggestions to add both language and library extension (=
in which case another proposal would be refered to)</div><div><br></div><di=
v>I mean: would it be possible to implement something like this?</div><div>=
<br></div><div>=C2=A0 =C2=A0 for_each( range_a, range_b, range_c, []( A&=
; a, B& b, C& c ) { ... } ); ?</div><div><br></div><div>or=C2=A0</d=
iv><div><br></div><div>=C2=A0 =C2=A0 for_each( parallel_iter{range_a, range=
_b, range_c}, []( A& a, B& b, C& c ) { ... } ); // specializati=
on</div><div><br></div><div>which would allow paramet:</div><div><br></div>=
<div>=C2=A0 =C2=A0 for_each( parallel_iter_default_value{range_a, range_b, =
range_c}, []( A& a, B& b, C& c ) { ... } ); =C2=A0// specializa=
tion<br></div><div><br></div><div>which would iterate for each value of any=
of the ranges even if there is no values anymore in the other ranges,</div=
><div>and will provide value-initialized values to the callback for these m=
issing values instead of stopping as soon any range is finished.</div><div>=
<br></div><div>I'm not suggesting to fully explore these suggestions, I=
would prefer the proposed solution, but I think</div><div>something like t=
his will be suggested as alternative, so providing comparison might help th=
e proposal.</div><div><br></div></div><div class=3D"gmail_extra"><br><div c=
lass=3D"gmail_quote">On 28 August 2015 at 11:28, Izzy Coding <span dir=3D"l=
tr"><<a href=3D"mailto:matthew.i.greenwood@gmail.com" target=3D"_blank">=
matthew.i.greenwood@gmail.com</a>></span> wrote:<br><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex">Great stuff.<br>
<br>
New version can be found here:<br>
<a href=3D"https://drive.google.com/open?id=3D0B26UZ0CbMay5RG5NRERxWlBFNG8"=
rel=3D"noreferrer" target=3D"_blank">https://drive.google.com/open?id=3D0B=
26UZ0CbMay5RG5NRERxWlBFNG8</a><br>
<br>
Hope I have not missed anything.<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
--<br>
<br>
---<br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-propo=
sals+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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" rel=3D"noreferrer" target=3D"_blank">http://groups.google.c=
om/a/isocpp.org/group/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c340143420e9051e6637f9--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Sat, 29 Aug 2015 02:23:19 -0700 (PDT)
Raw View
------=_Part_1431_207122633.1440840199558
Content-Type: text/plain; charset=UTF-8
I agree with the idea to add information about possible library support. I believe both should be implemented and have added a comment that this should be proposed separately.
Here is the new version:
https://drive.google.com/open?id=0B26UZ0CbMay5NGhsNmlnMjQtV0U
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_1431_207122633.1440840199558--
.
Author: "T. C." <rs2740@gmail.com>
Date: Sat, 29 Aug 2015 17:55:29 -0700 (PDT)
Raw View
------=_Part_1757_858978308.1440896129748
Content-Type: multipart/alternative;
boundary="----=_Part_1758_626885023.1440896129748"
------=_Part_1758_626885023.1440896129748
Content-Type: text/plain; charset=UTF-8
On Saturday, August 29, 2015 at 5:23:19 AM UTC-4, Izzy Coding wrote:
>
> I agree with the idea to add information about possible library support. I
> believe both should be implemented and have added a comment that this
> should be proposed separately.
>
> Here is the new version:
> https://drive.google.com/open?id=0B26UZ0CbMay5NGhsNmlnMjQtV0U
>
That doesn't seem sufficient to me. The bar for a language feature is
considerably higher than that of a library feature, and you really need to
show that a language feature can do something a library feature cannot.
Merely "nobody is proposing this at this time" is insufficient.
Here are some arguments for the language version:
- Easier to teach, read, and write. Doesn't require lambdas. Natural
extension of existing syntax.
- Allows use of break & return, so you can terminate early. The library
equivalent would require abusing exceptions.
- If the library version takes iterators, it's considerably more verbose.
If the library version takes ranges, it's hard to implement the special
begin/end lookup rules for range-for (in particular, the final step
performs an ADL-only lookup that is not used anywhere else in C++),
introducing subtle semantic differences.
- A std::for_each(Ranges..., Function) is possible but complex to implement
(a function parameter pack not at the end is a non-deduced context; to
avoid that, you basically have to do for_each(Args...), taking the whole
thing as a pack, and then do some special processing to unpack). A
std::for_each(Function, Ranges...) can be implemented as is, but doesn't
match existing version of `for_each` and a call to it is hard to read
(because it puts the ranges last).
- Reduced library dependency, and usable on freestanding implementations,
which may not have <iterator> or <algorithm>.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_1758_626885023.1440896129748
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Saturday, August 29, 2015 at 5:23:19 AM UTC-4, =
Izzy Coding wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">I agree with=
the idea to add information about possible library support. I believe both=
should be implemented and have added a comment that this should be propose=
d separately.<p>Here is the new version:<br><a href=3D"https://drive.google=
..com/open?id=3D0B26UZ0CbMay5NGhsNmlnMjQtV0U" target=3D"_blank" rel=3D"nofol=
low" onmousedown=3D"this.href=3D'https://drive.google.com/open?id\0750B=
26UZ0CbMay5NGhsNmlnMjQtV0U';return true;" onclick=3D"this.href=3D'h=
ttps://drive.google.com/open?id\0750B26UZ0CbMay5NGhsNmlnMjQtV0U';return=
true;">https://drive.google.com/open?<wbr>id=3D<wbr>0B26UZ0CbMay5NGhsNmlnM=
jQtV0U</a></p></blockquote><div><br></div><div>That doesn't seem suffic=
ient to me. The bar for a language feature is considerably higher than that=
of a library feature, and you really need to show that a language feature =
can do something a library feature cannot. Merely "nobody is proposing=
this at this time" is insufficient.</div><div><br></div><div>Here are=
some arguments for the language version:</div><div>- Easier to teach, read=
, and write. Doesn't require lambdas. Natural extension of existing syn=
tax.</div><div>- Allows use of break & return, so you can terminate ear=
ly. The library equivalent would require abusing exceptions.</div><div>- If=
the library version takes iterators, it's considerably more verbose. I=
f the library version takes ranges, it's hard to implement the special =
begin/end lookup rules for range-for (in particular, the final step perform=
s an ADL-only lookup that is not used anywhere else in C++), introducing su=
btle semantic differences.</div><div>- A std::for_each(Ranges..., Function)=
is possible but complex to implement (a function parameter pack not at the=
end is a non-deduced context; to avoid that, you basically have to do for_=
each(Args...), =C2=A0taking the whole thing as a pack, and then do some spe=
cial processing to unpack). A std::for_each(Function, Ranges...) can be imp=
lemented as is, but doesn't match existing version of `for_each` and a =
call to it is hard to read (because it puts the ranges last).</div><div>- R=
educed library dependency, and usable on freestanding implementations, whic=
h may not have <iterator> or <algorithm>.</div><div><br></div><=
/div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_1758_626885023.1440896129748--
------=_Part_1757_858978308.1440896129748--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Sun, 30 Aug 2015 15:48:56 -0700 (PDT)
Raw View
------=_Part_620_227807216.1440974936888
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Thanks for the info. I knew I was missing something really important. I hav=
e now added this into the proposal. I hope this will now sit much better wi=
th everyone. Although it may still need a few weeks here and there I feel t=
his is now much more complete. Please do keep any comments coming in.
Latest version can be viewed here:
https://drive.google.com/open?id=3D0B26UZ0CbMay5THZlSFlPLXRBNzQ
Fingers crossed
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_620_227807216.1440974936888--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Sun, 30 Aug 2015 15:49:56 -0700 (PDT)
Raw View
------=_Part_2316_293630187.1440974996898
Content-Type: text/plain; charset=UTF-8
I meant to say tweeks not weeks :-)
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_2316_293630187.1440974996898--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Mon, 31 Aug 2015 09:54:26 +0300
Raw View
On 31 August 2015 at 01:49, Izzy Coding <matthew.i.greenwood@gmail.com> wrote:
> I meant to say tweeks not weeks :-)
It's EWG, not EWB, when referring to the Evolution Working Group.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Mon, 31 Aug 2015 00:03:24 -0700 (PDT)
Raw View
------=_Part_46_1414170899.1441004604454
Content-Type: text/plain; charset=UTF-8
Aha, yes, just spotted that one myself.
Consider that to be rectified.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_46_1414170899.1441004604454--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Mon, 31 Aug 2015 16:06:43 +0200
Raw View
--001a11c1b70c8492ab051e9bf184
Content-Type: text/plain; charset=UTF-8
I tried to implement this version (that you didn't mention in the paper) of
an overload of for_each():
for_each( parallel_iter{range_a, range_b, range_c}, []( A& a, B& b, C&
c ) { ... } ); // specialization
Unfortunately I lost my work when it was almost finished and have to write
it again (some key combination in wnaderbox delete everything);
I plan to write it again before the end of this day, so that we have an
actual thing to compare to.
On 31 August 2015 at 09:03, Izzy Coding <matthew.i.greenwood@gmail.com>
wrote:
> Aha, yes, just spotted that one myself.
> Consider that to be rectified.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--001a11c1b70c8492ab051e9bf184
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I tried to implement this version (that you didn't men=
tion in the paper) of an overload of for_each():<div><br></div><div><div st=
yle=3D"font-size:12.8000001907349px">=C2=A0 =C2=A0 for_each( parallel_iter{=
range_a, range_b, range_c}, []( A& a, B& b, C& c ) { ... } ); /=
/ specialization</div></div><div>=C2=A0</div><div>Unfortunately I lost my w=
ork when it was almost finished and have to write it again (some key combin=
ation in wnaderbox delete everything);</div><div>I plan to write it again b=
efore the end of this day, so that we have an actual thing to compare to.</=
div><div><br></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail=
_quote">On 31 August 2015 at 09:03, Izzy Coding <span dir=3D"ltr"><<a hr=
ef=3D"mailto:matthew.i.greenwood@gmail.com" target=3D"_blank">matthew.i.gre=
enwood@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote"=
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah=
a, yes, just spotted that one myself.<br>
Consider that to be rectified.<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
--<br>
<br>
---<br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-propo=
sals+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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" rel=3D"noreferrer" target=3D"_blank">http://groups.google.c=
om/a/isocpp.org/group/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c1b70c8492ab051e9bf184--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Mon, 31 Aug 2015 11:47:02 -0700 (PDT)
Raw View
------=_Part_3625_477549257.1441046822597
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I would be very interested to see that implementation. I only left that out=
as I don't currently understand how it would be possible to map from paral=
lel_iter ranges to each of the parameters of the lamda. Also did not know i=
f it was possible as how does the algorithm know the count of ranges in ord=
er to be able to specify the required parameters for the lamda?
As I said I would however be very interested in seeing a possible implement=
ation for it.
I was possibly thinking about adding this addition into the proposal so tha=
t both possibilities are available as I believe that they have a close rela=
tion and should probably be implemented together.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_3625_477549257.1441046822597--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Mon, 31 Aug 2015 22:48:20 +0200
Raw View
--001a11c3ba82ca3c64051ea18dd9
Content-Type: text/plain; charset=UTF-8
On 31 August 2015 at 20:47, Izzy Coding <matthew.i.greenwood@gmail.com>
wrote:
> I would be very interested to see that implementation. I only left that
> out as I don't currently understand how it would be possible to map from
> parallel_iter ranges to each of the parameters of the lamda. Also did not
> know if it was possible as how does the algorithm know the count of ranges
> in order to be able to specify the required parameters for the lamda?
>
>
As said I didn't get to the end of the thing, but I used C++14 features (a
lot of variadics and lambdas) plus std::experimental::apply() function to
do the following in parallel_iter:
- extract begin and end iterators from all the ranges on construction (in
two tuples);
- provide a function to iterate all initially-begin iterators for each
range, one time;
- provide a function to check if any of these iterator reached end; <<
this one could be changed to get another semantic, like generating default
values for iterators that are already end
- provide a function calling a function with each value defered from each
iterator from each range (this required a double apply to extract values by
reference)
Then add a function to "make" this type given a bunch ranges, and the
for_each algorithm becomes (from memory)
template< class Func, class... RangeList >
void for_each( parallel_iter<RangeList...>&& range_list, Func&& func ) //
here parallel_iter is a specific type, so this is a specialization
{
while(range_list.valid_iterators())
{
range_list.apply( std::forward<Func>(func) );
range_list.next(); // increment iterators
}
}
At this point the algorithm knows how many ranges exists as it have the
RangeList.
(damn I was so close....)
Note that I think such function might be better with a different name than
for_each.
As I said I would however be very interested in seeing a possible
> implementation for it.
>
>
I'm getting back at you when I get somewhere (in the night certainly).
> I was possibly thinking about adding this addition into the proposal so
> that both possibilities are available as I believe that they have a close
> relation and should probably be implemented together.
>
>
Yes if it is possible to complete.
Also, I'm not a specialist so I don't know if I was breaking any standard
guarantees.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--001a11c3ba82ca3c64051ea18dd9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 31 August 2015 at 20:47, Izzy Coding <span dir=3D"ltr"><<a href=
=3D"mailto:matthew.i.greenwood@gmail.com" target=3D"_blank">matthew.i.green=
wood@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rg=
b(204,204,204);border-left-style:solid;padding-left:1ex">I would be very in=
terested to see that implementation. I only left that out as I don't cu=
rrently understand how it would be possible to map from parallel_iter range=
s to each of the parameters of the lamda. Also did not know if it was possi=
ble as how does the algorithm know the count of ranges in order to be able =
to specify the required parameters for the lamda?<br>
<br></blockquote><div><br></div><div>As said I didn't get to the end of=
the thing, but I used C++14 features (a lot of variadics and lambdas) plus=
std::experimental::apply() function to do the following in parallel_iter:<=
/div><div><br></div><div>=C2=A0- extract begin and end iterators from all t=
he ranges on construction (in two tuples);</div><div>=C2=A0- provide a func=
tion to iterate all initially-begin iterators for each range, one time;</di=
v><div>=C2=A0- provide a function to check if any of these iterator reached=
end; << this one could be changed to get another semantic, like gene=
rating default values for iterators that are already end</div><div>=C2=A0- =
provide a function calling a function with each value defered from each ite=
rator from each range (this required a double apply to extract values by re=
ference)</div><div><br></div><div>Then add a function to "make" t=
his type given a bunch ranges, and the for_each algorithm becomes (from mem=
ory)</div><div><br></div><div>template< class Func, class... RangeList &=
gt;</div><div>void for_each( parallel_iter<RangeList...>&& ra=
nge_list, Func&& func ) // here parallel_iter is a specific type, s=
o this is a specialization</div><div>{</div><div>=C2=A0 =C2=A0 while(range_=
list.valid_iterators())</div><div>=C2=A0 =C2=A0 {</div><div>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 range_list.apply( std::forward<Func>(func) );</div><div=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 range_list.next(); // increment iterators</div=
><div>=C2=A0 =C2=A0 }</div><div>}</div><div><br></div><div>At this point th=
e algorithm knows how many ranges exists as it have the RangeList.</div><di=
v>(damn I was so close....)</div><div><br></div><div>Note that I think such=
function might be better with a different name than for_each.</div><div><b=
r></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex=
;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style=
:solid;padding-left:1ex">
As I said I would however be very interested in seeing a possible implement=
ation for it.<br>
<br></blockquote><div><br></div><div>I'm getting back at you when I get=
somewhere (in the night certainly).</div><div>=C2=A0</div><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;b=
order-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"=
>
I was possibly thinking about adding this addition into the proposal so tha=
t both possibilities are available as I believe that they have a close rela=
tion and should probably be implemented together.<br>
<div class=3D""><div class=3D"h5"><br></div></div></blockquote><div><br></d=
iv><div>Yes if it is possible to complete.</div><div>Also, I'm not a sp=
ecialist so I don't know if I was breaking any standard guarantees.</di=
v><div><br></div><div><br></div></div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c3ba82ca3c64051ea18dd9--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Tue, 1 Sep 2015 01:36:30 +0200
Raw View
--001a11c33e6e314fc6051ea3e78b
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On 31 August 2015 at 22:48, Klaim - Jo=C3=ABl Lamotte <mjklaim@gmail.com> w=
rote:
>
> I'm getting back at you when I get somewhere (in the night certainly).
>
>
>> I was possibly thinking about adding this addition into the proposal so
>> that both possibilities are available as I believe that they have a clos=
e
>> relation and should probably be implemented together.
>>
>>
> Yes if it is possible to complete.
> Also, I'm not a specialist so I don't know if I was breaking any standard
> guarantees.
>
>
>
OK I managed to make it work :)
See: http://melpon.org/wandbox/permlink/m3bbQn601kQzZevb
(I'll copy the full code at the end of this email to avoid losing it)
Not sure if it's actually generic and all, but this:
int main()
{
using namespace experiment;
const std::vector<int> v { 1, 2, 3, 4, 5, 0, 1, 2, 3 };
const std::list<float> l { 1.0f, 2.0f, 0.5f, 0.0f };
const auto i =3D { "hello", "world", " !", " wow", "???" };
std::vector<std::pair<double,std::string>> results;
// don't allow write yet
for_each( in_parallel( v, l, i ), [&]( int a, float b, auto&& c ){
results.emplace_back( a * b, std::forward<decltype(c)>(c) );
} );
std::cout << "RESULTS : " << std::endl;
for( const auto& pair : results )
std::cout<< " " << pair.first << " : " << pair.second <<
std::endl;
std::cout << "RESULTS - END " << std::endl;
}
Compiles and run on Wandbox with:
- gcc 6.0/trunk C++14 and C++1z
- gcc 5.2.0 C++14 and C++1z
- clang 3.8/head C++14 and C++1z
It does not compile with clang 3.6 because the <experimental/utility>
header is not available.
The implementation is certainly optimizable (though I avoided most copies).
Also, I'm not sure how to determine which iterator type I should use for
each range. But I guess a function just to build a tuple type of iterator
types using a sequence of range type might allow this.
Also I'm not a specialist with metaprog so I suspect that some of the
recursion is not as efficient as some other recent techniques.
Anyway, it's possible to implement a for_each this way( though with
different guarantees?).
That was fun. :D
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--001a11c33e6e314fc6051ea3e78b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 31 August 2015 at 22:48, Klaim - Jo=C3=ABl Lamotte <span dir=3D"ltr"=
><<a href=3D"mailto:mjklaim@gmail.com" target=3D"_blank">mjklaim@gmail.c=
om</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,20=
4);border-left-style:solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D=
"gmail_extra"><div class=3D"gmail_quote"><span class=3D""><div><br></div></=
span><div>I'm getting back at you when I get somewhere (in the night ce=
rtainly).</div><span class=3D""><div>=C2=A0</div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left=
-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I was possibly thinking about adding this addition into the proposal so tha=
t both possibilities are available as I believe that they have a close rela=
tion and should probably be implemented together.<br>
<div><div><br></div></div></blockquote><div><br></div></span><div>Yes if it=
is possible to complete.</div><div>Also, I'm not a specialist so I don=
't know if I was breaking any standard guarantees.</div><div><br></div>=
<div><br></div></div></div></div></blockquote><div><br></div><div>OK I mana=
ged to make it work :)</div><div><div>See:=C2=A0<a href=3D"http://melpon.or=
g/wandbox/permlink/m3bbQn601kQzZevb">http://melpon.org/wandbox/permlink/m3b=
bQn601kQzZevb</a></div><div>(I'll copy the full code at the end of this=
email to avoid losing it)</div></div><div><br></div><div>Not sure if it=
9;s actually generic and all, but this:</div><div><br></div><div><div>int m=
ain()</div><div>{</div><div>=C2=A0 =C2=A0 using namespace experiment;</div>=
<div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 const std::vector<int&g=
t; v { 1, 2, 3, 4, 5, 0, 1, 2, 3 };</div><div>=C2=A0 =C2=A0 const std::list=
<float> l { 1.0f, 2.0f, 0.5f, 0.0f };</div><div>=C2=A0 =C2=A0 const a=
uto i =3D { "hello", "world", " !", " wo=
w", "???" };</div><div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =
=C2=A0 std::vector<std::pair<double,std::string>> results;</div=
><div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 // don't allow write =
yet</div><div>=C2=A0 =C2=A0 for_each( in_parallel( v, l, i ), [&]( int =
a, float b, auto&& c ){</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 resul=
ts.emplace_back( a * b, std::forward<decltype(c)>(c) );</div><div>=C2=
=A0 =C2=A0 } );</div><div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 std::=
cout << "RESULTS : " << std::endl;</div><div>=C2=A0 =
=C2=A0 for( const auto& pair : results )</div><div>=C2=A0 =C2=A0 =C2=A0=
=C2=A0 std::cout<< " =C2=A0 =C2=A0" << pair.first &l=
t;< " : " << pair.second << std::endl;</div><div>=
=C2=A0 =C2=A0 std::cout << "RESULTS - END " << std::e=
ndl; =C2=A0 =C2=A0</div><div>}</div></div><div><br></div><div><br></div><di=
v>Compiles and run on Wandbox with:</div><div>=C2=A0- gcc 6.0/trunk C++14 a=
nd C++1z</div><div>=C2=A0- gcc 5.2.0 C++14 and C++1z</div><div>=C2=A0- clan=
g 3.8/head C++14 and C++1z</div><div>=C2=A0It does not compile with clang 3=
..6 because the <experimental/utility>=C2=A0</div><div>header is not a=
vailable.</div><div><br></div><div><br></div><div>The implementation is cer=
tainly optimizable (though I avoided most copies).</div><div>Also, I'm =
not sure how to determine which iterator type I should use for</div><div>ea=
ch range. But I guess a function just to build a tuple type of iterator typ=
es using a sequence of range type might allow this.</div><div><br></div><di=
v>Also I'm not a specialist with metaprog so I suspect that some of the=
recursion is not as efficient as some other recent techniques.</div><div><=
br></div><div>Anyway, it's possible to implement a for_each this way( t=
hough with different guarantees?).</div><div><br></div><div>That was fun. :=
D</div><div><br></div><div><br></div><div>=C2=A0</div><div>=C2=A0</div></di=
v><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c33e6e314fc6051ea3e78b--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Tue, 1 Sep 2015 01:37:13 +0200
Raw View
--001a11c34014c1a556051ea3e913
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On 1 September 2015 at 01:36, Klaim - Jo=C3=ABl Lamotte <mjklaim@gmail.com>
wrote:
> OK I managed to make it work :)
> See: http://melpon.org/wandbox/permlink/m3bbQn601kQzZevb
> (I'll copy the full code at the end of this email to avoid losing it)
>
The full code:
---------------------------------
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <tuple>
#include <initializer_list>
#include <experimental/tuple>
#include <type_traits>
#include <algorithm>
#include <utility>
namespace stdex =3D std::experimental;
namespace experiment
{
template< class Iterator >
void increment( Iterator&& it )
{
++std::forward<Iterator>(it);
}
template< class FirstIter, class... OtherIters >
void increment( FirstIter&& first, OtherIters&&... others )
{
increment( std::forward<FirstIter>(first) );
increment( std::forward<OtherIters>(others)... );
}
template< class LeftIter, class RightIter >
bool is_equal( LeftIter&& left, RightIter&& right )
{
return std::forward<LeftIter>(left) =3D=3D
std::forward<RightIter>(right);
}
// I'm using structs to be able to do partial specialization for index
=3D=3D 0
template< std::size_t index >
struct any_equal
{
template< class LeftIterTuple, class RightIterTuple >
constexpr bool operator()( LeftIterTuple&& lefts, RightIterTuple&&
rights ) const
{
if( is_equal( std::get<index>(
std::forward<LeftIterTuple>(lefts) )
, std::get<index>( std::forward<RightIterTuple>(rights) )
)
)
return true;
else
return any_equal<index - 1>{}(
std::forward<LeftIterTuple>(lefts)
,
std::forward<RightIterTuple>(rights) );
}
};
template<>
struct any_equal<0>
{
template< class LeftIterTuple, class RightIterTuple >
constexpr bool operator()( LeftIterTuple&& lefts, RightIterTuple&&
rights ) const
{
return is_equal( std::get<0>(
std::forward<LeftIterTuple>(lefts) )
, std::get<0>( std::forward<RightIterTuple>(rights) )
) ;
}
};
template< class... RangeRefList >
struct parallel_iterator
{
static constexpr std::size_t rangelist_size =3D
sizeof...(RangeRefList);
static_assert( rangelist_size > 0, "range list too low");
// Note: sentinel types and non-const-iterator types are not
considered for this example.
template< class RangeType >
using IteratorType =3D typename
std::decay_t<RangeType>::const_iterator;
using IteratorTuple =3D std::tuple<IteratorType<RangeRefList>...>;
IteratorTuple ranges_end;
IteratorTuple ranges_it;
template< class FirstRange, class SecondRange, class... OtherRanges
>
parallel_iterator( FirstRange&& first, SecondRange&& second,
OtherRanges&&... others )
: ranges_end{ end(first), end(second), end(others)... }
, ranges_it{ begin(first), begin(second), begin(others)... }
{}
bool valid_iterators() const
{
static constexpr std::size_t start_index =3D rangelist_size - 1=
;
static_assert( start_index >=3D 0, "Invalid index" );
return !any_equal<start_index>{}( ranges_it, ranges_end );
}
template< class Func >
void apply( Func&& func )
{
stdex::apply( [&]( auto&&... iterators ){
stdex::apply( [&] ( auto&&... values ){
func( std::forward<decltype(values)>(values)... );
}, std::forward_as_tuple( *iterators... ) );
}, ranges_it );
}
void next()
{
stdex::apply( []( auto&&... iter ){
increment( std::forward<decltype(iter)>(iter)... );
}, ranges_it );
}
};
template< class... RangeList >
auto in_parallel( RangeList&&... range_list )
{
return parallel_iterator<RangeList...>{
std::forward<RangeList>(range_list)... };
}
template< class Func, class... RangeList >
void for_each( parallel_iterator<RangeList...>&& range_list, Func&&
func )
{
while(range_list.valid_iterators())
{
range_list.apply( std::forward<Func>(func) );
range_list.next();
}
}
}
int main()
{
using namespace experiment;
const std::vector<int> v { 1, 2, 3, 4, 5, 0, 1, 2, 3 };
const std::list<float> l { 1.0f, 2.0f, 0.5f, 0.0f };
const auto i =3D { "hello", "world", " !", " wow", "???" };
std::vector<std::pair<double,std::string>> results;
// don't allow write yet
for_each( in_parallel( v, l, i ), [&]( int a, float b, auto&& c ){
results.emplace_back( a * b, std::forward<decltype(c)>(c) );
} );
std::cout << "RESULTS : " << std::endl;
for( const auto& pair : results )
std::cout<< " " << pair.first << " : " << pair.second <<
std::endl;
std::cout << "RESULTS - END " << std::endl;
}
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--001a11c34014c1a556051ea3e913
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
On 1 September 2015 at 01:36, Klaim - Jo=C3=ABl Lamotte <span dir=3D"ltr">&=
lt;<a href=3D"mailto:mjklaim@gmail.com" target=3D"_blank">mjklaim@gmail.com=
</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204)=
;border-left-style:solid;padding-left:1ex"><div>OK I managed to make it wor=
k :)</div><div><div>See:=C2=A0<a href=3D"http://melpon.org/wandbox/permlink=
/m3bbQn601kQzZevb" target=3D"_blank">http://melpon.org/wandbox/permlink/m3b=
bQn601kQzZevb</a></div><div>(I'll copy the full code at the end of this=
email to avoid losing it)</div></div></blockquote></div><br>The full code:=
</div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">-----=
----------------------------</div><div class=3D"gmail_extra"><br></div><div=
class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"><div class=3D"g=
mail_extra">#include <iostream></div><div class=3D"gmail_extra">#incl=
ude <list></div><div class=3D"gmail_extra">#include <vector></d=
iv><div class=3D"gmail_extra">#include <string></div><div class=3D"gm=
ail_extra">#include <tuple></div><div class=3D"gmail_extra">#include =
<initializer_list></div><div class=3D"gmail_extra">#include <exper=
imental/tuple></div><div class=3D"gmail_extra">#include <type_traits&=
gt;</div><div class=3D"gmail_extra">#include <algorithm></div><div cl=
ass=3D"gmail_extra">#include <utility></div><div class=3D"gmail_extra=
"><br></div><div class=3D"gmail_extra">namespace stdex =3D std::experimenta=
l;</div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">nam=
espace experiment</div><div class=3D"gmail_extra">{</div><div class=3D"gmai=
l_extra"><br></div><div class=3D"gmail_extra">=C2=A0 =C2=A0 template< cl=
ass Iterator ></div><div class=3D"gmail_extra">=C2=A0 =C2=A0 void increm=
ent( Iterator&& it )</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =
{</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 ++std::forwar=
d<Iterator>(it);</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 }</div=
><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"><br></div>=
<div class=3D"gmail_extra">=C2=A0 =C2=A0 template< class FirstIter, clas=
s... OtherIters ></div><div class=3D"gmail_extra">=C2=A0 =C2=A0 void inc=
rement( FirstIter&& first, OtherIters&&... others )</div><d=
iv class=3D"gmail_extra">=C2=A0 =C2=A0 {</div><div class=3D"gmail_extra">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 increment( std::forward<FirstIter>(first)=
);</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 increment( =
std::forward<OtherIters>(others)... );</div><div class=3D"gmail_extra=
">=C2=A0 =C2=A0 }</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 template< class LeftIt=
er, class RightIter ></div><div class=3D"gmail_extra">=C2=A0 =C2=A0 bool=
is_equal( LeftIter&& left, RightIter&& right )</div><div c=
lass=3D"gmail_extra">=C2=A0 =C2=A0 {</div><div class=3D"gmail_extra">=C2=A0=
=C2=A0 =C2=A0 =C2=A0 return std::forward<LeftIter>(left) =3D=3D std:=
:forward<RightIter>(right);</div><div class=3D"gmail_extra">=C2=A0 =
=C2=A0 }</div><div class=3D"gmail_extra">=C2=A0 =C2=A0=C2=A0</div><div clas=
s=3D"gmail_extra">=C2=A0 =C2=A0 // I'm using structs to be able to do p=
artial specialization for index =3D=3D 0</div><div class=3D"gmail_extra">=
=C2=A0 =C2=A0 template< std::size_t index ></div><div class=3D"gmail_=
extra">=C2=A0 =C2=A0 struct any_equal</div><div class=3D"gmail_extra">=C2=
=A0 =C2=A0 {</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 te=
mplate< class LeftIterTuple, class RightIterTuple ></div><div class=
=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 constexpr bool operator()( Lef=
tIterTuple&& lefts, RightIterTuple&& rights ) const</div><d=
iv class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {</div><div class=3D"g=
mail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if( is_equal( std::ge=
t<index>( std::forward<LeftIterTuple>(lefts) )</div><div class=
=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 , =
std::get<index>( std::forward<RightIterTuple>(rights) )</div><d=
iv class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 )=C2=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 )</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return true;</div><div class=3D"gmail_extra">=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 else=C2=A0</div><div class=3D"gma=
il_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return an=
y_equal<index - 1>{}( std::forward<LeftIterTuple>(lefts)</div><=
div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0, std::forward<RightIterTup=
le>(rights) );</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 } =C2=A0 =C2=A0 =C2=A0 =C2=A0</div><div class=3D"gmail_extra">=C2=A0 =
=C2=A0 };</div><div class=3D"gmail_extra">=C2=A0 =C2=A0=C2=A0</div><div cla=
ss=3D"gmail_extra">=C2=A0 =C2=A0 template<></div><div class=3D"gmail_=
extra">=C2=A0 =C2=A0 struct any_equal<0></div><div class=3D"gmail_ext=
ra">=C2=A0 =C2=A0 {</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 template< class LeftIterTuple, class RightIterTuple ></div><di=
v class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 constexpr bool operator=
()( LeftIterTuple&& lefts, RightIterTuple&& rights ) const<=
/div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {</div><div cla=
ss=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return is_equa=
l( std::get<0>( std::forward<LeftIterTuple>(lefts) )</div><div =
class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 , std::get<0>( std::forward<RightIterTuple>(rights) )</div>=
<div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 ) ;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 } =
=C2=A0 =C2=A0 =C2=A0 =C2=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 }=
;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0=C2=A0</div><div class=3D"gm=
ail_extra">=C2=A0 =C2=A0=C2=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=
=A0 template< class... RangeRefList ></div><div class=3D"gmail_extra"=
>=C2=A0 =C2=A0 struct parallel_iterator</div><div class=3D"gmail_extra">=C2=
=A0 =C2=A0 {</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=
=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 static cons=
texpr std::size_t rangelist_size =3D sizeof...(RangeRefList);</div><div cla=
ss=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 static_assert(=
rangelist_size > 0, "range list too low");</div><div class=3D=
"gmail_extra"><br></div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 // Note: sentinel types and non-const-iterator types are not considered=
for this example.</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 template< class RangeType ></div><div class=3D"gmail_extra">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 using IteratorType =3D typename std::decay_t<Ra=
ngeType>::const_iterator;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 using IteratorTuple =3D std::tuple<IteratorType<RangeRe=
fList>...>;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0=C2=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 Itera=
torTuple ranges_end;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 IteratorTuple ranges_it;</div><div class=3D"gmail_extra">=C2=A0 =C2=
=A0 =C2=A0 =C2=A0=C2=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 template< class FirstRange, class SecondRange, class... Other=
Ranges ></div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 par=
allel_iterator( FirstRange&& first, SecondRange&& second, O=
therRanges&&... others )</div><div class=3D"gmail_extra">=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 : ranges_end{ end(first), end(second), end(=
others)... }</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 , ranges_it{ begin(first), begin(second), begin(others)... }<=
/div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {}</div><div cl=
ass=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0</div><div class=3D"gm=
ail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0</div><div class=3D"gmail_extra=
">=C2=A0 =C2=A0 =C2=A0 =C2=A0 bool valid_iterators() const</div><div class=
=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {</div><div class=3D"gmail_ext=
ra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 static constexpr std::size_t =
start_index =3D rangelist_size - 1;</div><div class=3D"gmail_extra">=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 static_assert( start_index >=3D 0, &q=
uot;Invalid index" );</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0</div><div class=3D"gmail_extra">=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return !any_equal<start_index>{}( =
ranges_it, ranges_end );</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 }</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=
=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 template<=
; class Func ></div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 void apply( Func&& func )</div><div class=3D"gmail_extra">=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 {</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 stdex::apply( [&]( auto&&... iterat=
ors ){</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 stdex::apply( [&] ( auto&&... values ){=C2=
=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 func( std::forward<decltype(values)>(=
values)... );</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }, std::forward_as_tuple( *iterators... ) );</d=
iv><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }, =
ranges_it );</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<=
/div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0</div><div=
class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 void next()</div><div cl=
ass=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {</div><div class=3D"gmail_=
extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stdex::apply( []( auto&=
;&... iter ){</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 increment( std::forward<decltype(iter)&g=
t;(iter)... );</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 }, ranges_it );</div><div class=3D"gmail_extra">=C2=A0 =C2=A0=
=C2=A0 =C2=A0 }</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=
=A0=C2=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 };</div><div class=
=3D"gmail_extra"><br></div><div class=3D"gmail_extra">=C2=A0 =C2=A0 templat=
e< class... RangeList ></div><div class=3D"gmail_extra">=C2=A0 =C2=A0=
auto in_parallel( RangeList&&... range_list )</div><div class=3D"g=
mail_extra">=C2=A0 =C2=A0 {</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 return parallel_iterator<RangeList...>{ std::forward<=
;RangeList>(range_list)... };</div><div class=3D"gmail_extra">=C2=A0 =C2=
=A0 }</div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">=
=C2=A0 =C2=A0 template< class Func, class... RangeList ></div><div cl=
ass=3D"gmail_extra">=C2=A0 =C2=A0 void for_each( parallel_iterator<Range=
List...>&& range_list, Func&& func )</div><div class=3D"=
gmail_extra">=C2=A0 =C2=A0 {</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 while(range_list.valid_iterators())</div><div class=3D"gmail_=
extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 {</div><div class=3D"gmail_extra">=C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 range_list.apply( std::forward<Func&=
gt;(func) );</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 range_list.next();</div><div class=3D"gmail_extra">=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 }</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 }</div><d=
iv class=3D"gmail_extra">}</div><div class=3D"gmail_extra"><br></div><div c=
lass=3D"gmail_extra"><br></div><div class=3D"gmail_extra">int main()</div><=
div class=3D"gmail_extra">{</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 u=
sing namespace experiment;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0=C2=
=A0</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 const std::vector<int&=
gt; v { 1, 2, 3, 4, 5, 0, 1, 2, 3 };</div><div class=3D"gmail_extra">=C2=A0=
=C2=A0 const std::list<float> l { 1.0f, 2.0f, 0.5f, 0.0f };</div><di=
v class=3D"gmail_extra">=C2=A0 =C2=A0 const auto i =3D { "hello",=
"world", " !", " wow", "???" };</d=
iv><div class=3D"gmail_extra">=C2=A0 =C2=A0=C2=A0</div><div class=3D"gmail_=
extra">=C2=A0 =C2=A0 std::vector<std::pair<double,std::string>>=
results;</div><div class=3D"gmail_extra">=C2=A0 =C2=A0=C2=A0</div><div cla=
ss=3D"gmail_extra">=C2=A0 =C2=A0 // don't allow write yet</div><div cla=
ss=3D"gmail_extra">=C2=A0 =C2=A0 for_each( in_parallel( v, l, i ), [&](=
int a, float b, auto&& c ){</div><div class=3D"gmail_extra">=C2=A0=
=C2=A0 =C2=A0 =C2=A0 results.emplace_back( a * b, std::forward<decltype=
(c)>(c) );</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 } );</div><div =
class=3D"gmail_extra">=C2=A0 =C2=A0=C2=A0</div><div class=3D"gmail_extra">=
=C2=A0 =C2=A0 std::cout << "RESULTS : " << std::endl;=
</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 for( const auto& pair : =
results )</div><div class=3D"gmail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 std::=
cout<< " =C2=A0 =C2=A0" << pair.first << "=
: " << pair.second << std::endl;</div><div class=3D"gmail=
_extra">=C2=A0 =C2=A0 std::cout << "RESULTS - END " <<=
; std::endl; =C2=A0 =C2=A0</div><div class=3D"gmail_extra">}</div><div><br>=
</div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c34014c1a556051ea3e913--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Tue, 1 Sep 2015 02:57:43 +0200
Raw View
--089e0158c3c0a30f35051ea50994
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On 1 September 2015 at 01:37, Klaim - Jo=C3=ABl Lamotte <mjklaim@gmail.com>
wrote:
>
> On 1 September 2015 at 01:36, Klaim - Jo=C3=ABl Lamotte <mjklaim@gmail.co=
m>
> wrote:
>
>> OK I managed to make it work :)
>> See: http://melpon.org/wandbox/permlink/m3bbQn601kQzZevb
>> (I'll copy the full code at the end of this email to avoid losing it)
>>
>
> The full code:
>
>
After some thinking:
- all the functions can be constexpr apparently (from my tests)
- the actual iterator to use can be infered using decltype with the
original range type and begin() end()
It seems to work as expected (though the test is not as complete as it
should be for a library solution):
http://melpon.org/wandbox/permlink/r7yEVwS70ZVEFjBV
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--089e0158c3c0a30f35051ea50994
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 1 September 2015 at 01:37, Klaim - Jo=C3=ABl Lamotte <span dir=3D"lt=
r"><<a href=3D"mailto:mjklaim@gmail.com" target=3D"_blank">mjklaim@gmail=
..com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,=
204);border-left-style:solid;padding-left:1ex"><div dir=3D"ltr"><div class=
=3D"gmail_extra"><span class=3D""><br><div class=3D"gmail_quote">On 1 Septe=
mber 2015 at 01:36, Klaim - Jo=C3=ABl Lamotte <span dir=3D"ltr"><<a href=
=3D"mailto:mjklaim@gmail.com" target=3D"_blank">mjklaim@gmail.com</a>></=
span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-le=
ft-style:solid;padding-left:1ex"><div>OK I managed to make it work :)</div>=
<div><div>See:=C2=A0<a href=3D"http://melpon.org/wandbox/permlink/m3bbQn601=
kQzZevb" target=3D"_blank">http://melpon.org/wandbox/permlink/m3bbQn601kQzZ=
evb</a></div><div>(I'll copy the full code at the end of this email to =
avoid losing it)</div></div></blockquote></div><br></span>The full code:</d=
iv><div class=3D"gmail_extra"><br></div></div></blockquote><div><br></div><=
div>After some thinking:</div><div>=C2=A0- =C2=A0all the functions can be c=
onstexpr apparently (from my tests)</div><div>=C2=A0- the actual iterator t=
o use can be infered using decltype with the original range type and begin(=
) end()</div><div>It seems to work as expected (though the test is not as c=
omplete as it should be for a library solution):</div><div><a href=3D"http:=
//melpon.org/wandbox/permlink/r7yEVwS70ZVEFjBV">http://melpon.org/wandbox/p=
ermlink/r7yEVwS70ZVEFjBV</a><br></div><div><br></div><div><br></div></div><=
/div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--089e0158c3c0a30f35051ea50994--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Tue, 1 Sep 2015 03:09:37 +0200
Raw View
--001a11c33e6e342b50051ea5344d
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On 1 September 2015 at 02:57, Klaim - Jo=C3=ABl Lamotte <mjklaim@gmail.com>
wrote:
>
>
> On 1 September 2015 at 01:37, Klaim - Jo=C3=ABl Lamotte <mjklaim@gmail.co=
m>
> wrote:
>
>>
>> On 1 September 2015 at 01:36, Klaim - Jo=C3=ABl Lamotte <mjklaim@gmail.c=
om>
>> wrote:
>>
>>> OK I managed to make it work :)
>>> See: http://melpon.org/wandbox/permlink/m3bbQn601kQzZevb
>>> (I'll copy the full code at the end of this email to avoid losing it)
>>>
>>
>> The full code:
>>
>>
> After some thinking:
> - all the functions can be constexpr apparently (from my tests)
> - the actual iterator to use can be infered using decltype with the
> original range type and begin() end()
> It seems to work as expected (though the test is not as complete as it
> should be for a library solution):
> http://melpon.org/wandbox/permlink/r7yEVwS70ZVEFjBV
>
>
>
Wooops, wrong link, sorry for the spam:
http://melpon.org/wandbox/permlink/gqhKDPZNl0Bp3mMA
I'm stopping here for now.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--001a11c33e6e342b50051ea5344d
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 1 September 2015 at 02:57, Klaim - Jo=C3=ABl Lamotte <span dir=3D"lt=
r"><<a href=3D"mailto:mjklaim@gmail.com" target=3D"_blank">mjklaim@gmail=
..com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,=
204);border-left-style:solid;padding-left:1ex"><div dir=3D"ltr"><br><div cl=
ass=3D"gmail_extra"><br><div class=3D"gmail_quote"><span class=3D"">On 1 Se=
ptember 2015 at 01:37, Klaim - Jo=C3=ABl Lamotte <span dir=3D"ltr"><<a h=
ref=3D"mailto:mjklaim@gmail.com" target=3D"_blank">mjklaim@gmail.com</a>>=
;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
x 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border=
-left-style:solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_ex=
tra"><span><br><div class=3D"gmail_quote">On 1 September 2015 at 01:36, Kla=
im - Jo=C3=ABl Lamotte <span dir=3D"ltr"><<a href=3D"mailto:mjklaim@gmai=
l.com" target=3D"_blank">mjklaim@gmail.com</a>></span> wrote:<br><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-wi=
dth:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-=
left:1ex"><div>OK I managed to make it work :)</div><div><div>See:=C2=A0<a =
href=3D"http://melpon.org/wandbox/permlink/m3bbQn601kQzZevb" target=3D"_bla=
nk">http://melpon.org/wandbox/permlink/m3bbQn601kQzZevb</a></div><div>(I=
9;ll copy the full code at the end of this email to avoid losing it)</div><=
/div></blockquote></div><br></span>The full code:</div><div class=3D"gmail_=
extra"><br></div></div></blockquote><div><br></div></span><div>After some t=
hinking:</div><div>=C2=A0- =C2=A0all the functions can be constexpr apparen=
tly (from my tests)</div><div>=C2=A0- the actual iterator to use can be inf=
ered using decltype with the original range type and begin() end()</div><di=
v>It seems to work as expected (though the test is not as complete as it sh=
ould be for a library solution):</div><div><a href=3D"http://melpon.org/wan=
dbox/permlink/r7yEVwS70ZVEFjBV" target=3D"_blank">http://melpon.org/wandbox=
/permlink/r7yEVwS70ZVEFjBV</a><br></div><div><br></div><div><br></div></div=
></div></div></blockquote><div><br></div><div>Wooops, wrong link, sorry for=
the spam: <a href=3D"http://melpon.org/wandbox/permlink/gqhKDPZNl0Bp3mMA">=
http://melpon.org/wandbox/permlink/gqhKDPZNl0Bp3mMA</a></div><div><br></div=
><div>I'm stopping here for now.</div><div>=C2=A0</div></div><br></div>=
</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c33e6e342b50051ea5344d--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Thu, 10 Sep 2015 01:04:36 -0700 (PDT)
Raw View
------=_Part_4738_747310613.1441872276677
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Sorry for late reply, sadly my daughter passed away so I have been with fam=
ily.
I hope you don't mind. I have added your example as a reference in my propo=
sal. Hopefully this might spark further discussions around the library impl=
ementation version. However I do believe both versions have their own merit=
s and probably should both be considered for standardisation.
Please find my latest version of the draft here:
https://drive.google.com/open?id=3D0B26UZ0CbMay5V2JWNUpfbkdyTUE
Still looking for any feedback. I will be submitting this proposal in the n=
ext few weeks ready to go out on committee mailing list before next committ=
ee meeting.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_4738_747310613.1441872276677--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Thu, 10 Sep 2015 13:28:59 +0200
Raw View
--001a11c3f310cf27cc051f62e763
Content-Type: text/plain; charset=UTF-8
On 10 September 2015 at 10:04, Izzy Coding <matthew.i.greenwood@gmail.com>
wrote:
> Sorry for late reply, sadly my daughter passed away so I have been with
> family.
>
> I am so sorry to hear about your loss. Don't worry about the timing, I
wasn't expecting immediate feedback anyway.
> I hope you don't mind. I have added your example as a reference in my
> proposal. Hopefully this might spark further discussions around the library
> implementation version. However I do believe both versions have their own
> merits and probably should both be considered for standardisation.
>
I agree. Though I used an unusual style of arguments passing and I don't
know if there is a reason for
avoiding this style.
>
> Please find my latest version of the draft here:
> https://drive.google.com/open?id=0B26UZ0CbMay5V2JWNUpfbkdyTUE
>
Still looking for any feedback. I will be submitting this proposal in the
> next few weeks ready to go out on committee mailing list before next
> committee meeting.
The proposal looks good to me in this version. It might trigger interesting
discussions too.
By the way you might want to ask Eric Niebler his input if not already done.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--001a11c3f310cf27cc051f62e763
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 10 September 2015 at 10:04, Izzy Coding <span dir=3D"ltr"><<a hre=
f=3D"mailto:matthew.i.greenwood@gmail.com" target=3D"_blank">matthew.i.gree=
nwood@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:r=
gb(204,204,204);border-left-style:solid;padding-left:1ex">Sorry for late re=
ply, sadly my daughter passed away so I have been with family.<br>
<br></blockquote><div>I am so sorry to hear about your loss. Don't worr=
y about the timing, I wasn't expecting immediate feedback anyway.</div>=
<div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-l=
eft-style:solid;padding-left:1ex">
I hope you don't mind. I have added your example as a reference in my p=
roposal. Hopefully this might spark further discussions around the library =
implementation version. However I do believe both versions have their own m=
erits and probably should both be considered for standardisation.<br></bloc=
kquote><div><br></div><div>I agree. Though I used an unusual style of argum=
ents passing and I don't know if there is a reason for</div><div>avoidi=
ng this style.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(2=
04,204,204);border-left-style:solid;padding-left:1ex">
<br>
Please find my latest version of the draft here:<br>
<a href=3D"https://drive.google.com/open?id=3D0B26UZ0CbMay5V2JWNUpfbkdyTUE"=
rel=3D"noreferrer" target=3D"_blank">https://drive.google.com/open?id=3D0B=
26UZ0CbMay5V2JWNUpfbkdyTUE</a><br></blockquote><blockquote class=3D"gmail_q=
uote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-c=
olor:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Still looking for any feedback. I will be submitting this proposal in the n=
ext few weeks ready to go out on committee mailing list before next committ=
ee meeting.</blockquote><div><br></div><div>The proposal looks good to me i=
n this version. It might trigger interesting discussions too.</div><div>By =
the way you might want to ask Eric Niebler his input if not already done.</=
div><div><br></div><div><br></div><div>=C2=A0</div></div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c3f310cf27cc051f62e763--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Thu, 10 Sep 2015 07:43:58 -0700 (PDT)
Raw View
------=_Part_3634_328284147.1441896238427
Content-Type: multipart/alternative;
boundary="----=_Part_3635_1634454164.1441896238427"
------=_Part_3635_1634454164.1441896238427
Content-Type: text/plain; charset=UTF-8
>
> By the way you might want to ask Eric Niebler his input if not already
> done.
>
How would I go about doing this?
Sorry I am relativley new to these things.... lol
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_3635_1634454164.1441896238427
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div><div class=3D"gmail_quote"><div>By the way you might want to ask E=
ric Niebler his input if not already done.</div></div></div></div></blockqu=
ote><div><br>How would I go about doing this?<br>Sorry I am relativley new =
to these things.... lol<br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_3635_1634454164.1441896238427--
------=_Part_3634_328284147.1441896238427--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Thu, 10 Sep 2015 10:48:24 -0700 (PDT)
Raw View
------=_Part_8318_1721599552.1441907304403
Content-Type: multipart/alternative;
boundary="----=_Part_8319_984896439.1441907304404"
------=_Part_8319_984896439.1441907304404
Content-Type: text/plain; charset=UTF-8
>
> By the way you might want to ask Eric Niebler his input if not already
>> done.
>>
>
> How would I go about doing this?
>
Think I got it. Just sent him an email to get his opinion. Just hope he
does not delete it thinking it is spam...lol
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_8319_984896439.1441907304404
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div clas=
s=3D"gmail_quote"><div>By the way you might want to ask Eric Niebler his in=
put if not already done.</div></div></div></div></blockquote><div><br>How w=
ould I go about doing this?<br></div></div></blockquote><div><br>Think I go=
t it. Just sent him an email to get his opinion. Just hope he does not dele=
te it thinking it is spam...lol<br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_8319_984896439.1441907304404--
------=_Part_8318_1721599552.1441907304403--
.
Author: "T. C." <rs2740@gmail.com>
Date: Fri, 11 Sep 2015 03:22:52 -0700 (PDT)
Raw View
------=_Part_581_321781596.1441966972798
Content-Type: multipart/alternative;
boundary="----=_Part_582_1638646185.1441966972798"
------=_Part_582_1638646185.1441966972798
Content-Type: text/plain; charset=UTF-8
On Thursday, September 10, 2015 at 4:04:37 AM UTC-4, Izzy Coding wrote:
>
> Sorry for late reply, sadly my daughter passed away so I have been with
> family.
I'm really sorry to hear that. Hope that everything is OK.
<snip>
Please find my latest version of the draft here:
> https://drive.google.com/open?id=0B26UZ0CbMay5V2JWNUpfbkdyTUE
>
> Still looking for any feedback. I will be submitting this proposal in the
> next few weeks ready to go out on committee mailing list before next
> committee meeting.
>
At the risk of getting eggs on my face, I'm now convinced that it is
possible to simulate an ADL-only lookup in ordinary C++ code. The point
about subtle semantic differences still stands, though, because I'm fairly
sure that step two (looking for member begin/end) is impossible to
perfectly emulate in code, as it requires distinguishing between having a
member called "begin" (or "end") that is inaccessible/not a function/have
the wrong number of parameters etc. and not having one at all.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_582_1638646185.1441966972798
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Thursday, September 10, 2015 at 4:04:37 AM UTC-=
4, Izzy Coding wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Sorry for=
late reply, sadly my daughter passed away so I have been with family.</blo=
ckquote><div><br></div><div>I'm really sorry to hear that. Hope that ev=
erything is OK.</div><div><br></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: r=
gb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">=C2=A0<=
snip></blockquote><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><p>Please=
find my latest version of the draft here:<br><a href=3D"https://drive.goog=
le.com/open?id=3D0B26UZ0CbMay5V2JWNUpfbkdyTUE" target=3D"_blank" rel=3D"nof=
ollow" onmousedown=3D"this.href=3D'https://drive.google.com/open?id\075=
0B26UZ0CbMay5V2JWNUpfbkdyTUE';return true;" onclick=3D"this.href=3D'=
;https://drive.google.com/open?id\0750B26UZ0CbMay5V2JWNUpfbkdyTUE';retu=
rn true;">https://drive.google.com/open?<wbr>id=3D<wbr>0B26UZ0CbMay5V2JWNUp=
fbkdyTUE</a></p><p>Still looking for any feedback. I will be submitting thi=
s proposal in the next few weeks ready to go out on committee mailing list =
before next committee meeting.</p></blockquote><div><br></div><div>At the r=
isk of getting eggs on my face, I'm now convinced that it is possible t=
o simulate an ADL-only lookup in ordinary C++ code. The point about subtle =
semantic differences still stands, though, because I'm fairly sure that=
step two (looking for member begin/end) is impossible to perfectly emulate=
in code, as it requires distinguishing between having a member called &quo=
t;begin" (or "end") that is inaccessible/not a function/have=
the wrong number of parameters etc. and not having one at all.</div><div><=
br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_582_1638646185.1441966972798--
------=_Part_581_321781596.1441966972798--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Sat, 12 Sep 2015 01:11:45 -0700 (PDT)
Raw View
------=_Part_1447_1349938500.1442045505694
Content-Type: text/plain; charset=UTF-8
Surely the check for begin/end member functions would be done via concepts? Also if a template function calls a member function that does not exist surely it would not compile.
Not sure if concepts can do this, or if they would affect the lookup results?
I agree I am sure there is a way to be able to provide the functionality as a library feature. However I just don't know enough to be able to create it. Would be interested to work with someone who is more knowledgable in that area.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_1447_1349938500.1442045505694--
.
Author: "T. C." <rs2740@gmail.com>
Date: Sat, 12 Sep 2015 02:23:35 -0700 (PDT)
Raw View
------=_Part_1637_9879358.1442049815589
Content-Type: multipart/alternative;
boundary="----=_Part_1638_290798739.1442049815590"
------=_Part_1638_290798739.1442049815590
Content-Type: text/plain; charset=UTF-8
It's fairly straightforward to do "if r.begin() compiles, call it,
otherwise call begin(r)" (with the usual caveats about immediate context).
I'm not aware of any way to do "if the type of r has a member called
'begin', attempt to call r.begin(), otherwise call begin(r)" in normal C++
code, concepts or not. And the latter is what range-for does.
In other words, the library solution would accept some types that range-for
rejects.
On Saturday, September 12, 2015 at 4:11:46 AM UTC-4, Izzy Coding wrote:
>
> Surely the check for begin/end member functions would be done via
> concepts? Also if a template function calls a member function that does not
> exist surely it would not compile.
> Not sure if concepts can do this, or if they would affect the lookup
> results?
>
> I agree I am sure there is a way to be able to provide the functionality
> as a library feature. However I just don't know enough to be able to create
> it. Would be interested to work with someone who is more knowledgable in
> that area.
>
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_1638_290798739.1442049815590
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">It's fairly straightforward to do "if r.begin() c=
ompiles, call it, otherwise call begin(r)" (with the usual caveats abo=
ut immediate context).<div><br></div><div>I'm not aware of any way to d=
o "if the type of r has a member called 'begin', attempt to ca=
ll=C2=A0r.begin(), otherwise call begin(r)" in normal C++ code, concep=
ts or not. And the=C2=A0latter is what range-for does.</div><div><br></div>=
<div>In other words, the library solution would accept some types that rang=
e-for rejects.</div><div><br>On Saturday, September 12, 2015 at 4:11:46 AM =
UTC-4, Izzy Coding wrote:<blockquote class=3D"gmail_quote" style=3D"margin:=
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Surel=
y the check for begin/end member functions would be done via concepts? Also=
if a template function calls a member function that does not exist surely =
it would not compile.<br>Not sure if concepts can do this, or if they would=
affect the lookup results?<p>I agree I am sure there is a way to be able t=
o provide the functionality as a library feature. However I just don't =
know enough to be able to create it. Would be interested to work with someo=
ne who is more knowledgable in that area.</p></blockquote></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_1638_290798739.1442049815590--
------=_Part_1637_9879358.1442049815589--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Sat, 12 Sep 2015 22:17:44 +0200
Raw View
--001a11c238866d5dd2051f9286f8
Content-Type: text/plain; charset=UTF-8
On 10 September 2015 at 19:48, Izzy Coding <matthew.i.greenwood@gmail.com>
wrote:
> By the way you might want to ask Eric Niebler his input if not already
>>> done.
>>>
>>
>> How would I go about doing this?
>>
>
> Think I got it. Just sent him an email to get his opinion. Just hope he
> does not delete it thinking it is spam...lol
>
I was thinking about mailing him OR posting a heads-up on the Ranges
discussion group.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--001a11c238866d5dd2051f9286f8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 10 September 2015 at 19:48, Izzy Coding <span dir=3D"ltr"><<a hre=
f=3D"mailto:matthew.i.greenwood@gmail.com" target=3D"_blank">matthew.i.gree=
nwood@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><di=
v dir=3D"ltr"><span class=3D""><blockquote class=3D"gmail_quote" style=3D"m=
argin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div=
dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-lef=
t:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>=
<div class=3D"gmail_quote"><div>By the way you might want to ask Eric Niebl=
er his input if not already done.</div></div></div></div></blockquote><div>=
<br>How would I go about doing this?<br></div></div></blockquote></span><di=
v><br>Think I got it. Just sent him an email to get his opinion. Just hope =
he does not delete it thinking it is spam...lol</div></div></blockquote><di=
v><br></div><div>I was thinking about mailing him OR posting a heads-up on =
the Ranges discussion group.</div><div><br></div></div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c238866d5dd2051f9286f8--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Sat, 12 Sep 2015 22:24:02 +0200
Raw View
--089e01228320f7ea77051f929c0c
Content-Type: text/plain; charset=UTF-8
On 12 September 2015 at 11:23, T. C. <rs2740@gmail.com> wrote:
> It's fairly straightforward to do "if r.begin() compiles, call it,
> otherwise call begin(r)" (with the usual caveats about immediate context).
>
> I'm not aware of any way to do "if the type of r has a member called
> 'begin', attempt to call r.begin(), otherwise call begin(r)" in normal C++
> code, concepts or not. And the latter is what range-for does.
>
> In other words, the library solution would accept some types that
> range-for rejects.
>
>
If I understood you correctly (I'm not sure), this is already what
std::begin does: http://en.cppreference.com/w/cpp/iterator/begin
Although you need to use a using namespace declaration to benefit from ADL:
template< class Container >
void foo( Container&& container )
{
using namespace std; // allow to use std::begin if no Container's
namespace specific begin() function is provided
auto&& it = begin(container); // if no other option than std::begin()
is selected here, if container.begin() exists, use it, otherwise fails to
compile.
...
}
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--089e01228320f7ea77051f929c0c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 12 September 2015 at 11:23, T. C. <span dir=3D"ltr"><<a href=3D"m=
ailto:rs2740@gmail.com" target=3D"_blank">rs2740@gmail.com</a>></span> w=
rote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-styl=
e:solid;padding-left:1ex"><div dir=3D"ltr">It's fairly straightforward =
to do "if r.begin() compiles, call it, otherwise call begin(r)" (=
with the usual caveats about immediate context).<div><br></div><div>I'm=
not aware of any way to do "if the type of r has a member called '=
;begin', attempt to call=C2=A0r.begin(), otherwise call begin(r)" =
in normal C++ code, concepts or not. And the=C2=A0latter is what range-for =
does.</div><div><br></div><div>In other words, the library solution would a=
ccept some types that range-for rejects.</div><div><div class=3D"h5"><div><=
br></div></div></div></div></blockquote><div><br></div><div>If I understood=
you correctly (I'm not sure), this is already what std::begin does: <a=
href=3D"http://en.cppreference.com/w/cpp/iterator/begin">http://en.cpprefe=
rence.com/w/cpp/iterator/begin</a></div><div>Although you need to use a usi=
ng namespace declaration to benefit from ADL:</div><div><br></div><div>temp=
late< class Container ></div><div>void foo( Container&& conta=
iner )</div><div>{</div><div>=C2=A0 =C2=A0 =C2=A0using namespace std; // al=
low to use std::begin if no Container's namespace specific begin() func=
tion is provided</div><div>=C2=A0 =C2=A0 =C2=A0auto&& it =3D begin(=
container); // if no other option than std::begin() is selected here, if co=
ntainer.begin() exists, use it, otherwise fails to compile.</div><div>=C2=
=A0 =C2=A0 =C2=A0...</div><div>}</div><div><br></div><div>=C2=A0</div></div=
></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--089e01228320f7ea77051f929c0c--
.
Author: "T. C." <rs2740@gmail.com>
Date: Sat, 12 Sep 2015 13:44:59 -0700 (PDT)
Raw View
------=_Part_279_1469783035.1442090699128
Content-Type: multipart/alternative;
boundary="----=_Part_280_698935999.1442090699130"
------=_Part_280_698935999.1442090699130
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Saturday, September 12, 2015 at 4:24:04 PM UTC-4, Klaim - Jo=C3=ABl Lamo=
tte=20
wrote:
>
>
>
> If I understood you correctly (I'm not sure), this is already what=20
> std::begin does: http://en.cppreference.com/w/cpp/iterator/begin
> Although you need to use a using namespace declaration to benefit from AD=
L:
>
> template< class Container >
> void foo( Container&& container )
> {
> using namespace std; // allow to use std::begin if no Container's=20
> namespace specific begin() function is provided
> auto&& it =3D begin(container); // if no other option than std::begi=
n()=20
> is selected here, if container.begin() exists, use it, otherwise fails to=
=20
> compile.
> ...
> }
>
.... and you fell into one of the subtle traps here. You can't use an=20
overload set containing both `std::begin` and a `begin` found by ADL,=20
because the latter can be equally greedy (think something like boost::begin=
=20
- though they added an ADL barrier for that) and - voila - you get an=20
ambiguous call. See also=20
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3257.pdf.
Here's an example of what I mean:
namespace foo {
struct A { int begin; };=20
struct B { using end =3D int; };
class C { int* begin(); int *end(); }; // inaccessible
struct D { int* begin(int); int* end();};
struct E {};
template<class T> int* begin(const T&) { return nullptr; }
template<class T> int* end(const T&) { return nullptr; }
}
int main() {
foo::A a; foo::B b; foo::C c; foo::D d; foo::E e;
for(auto i1 : a) { } // doesn't compile
for(auto i2 : b) { } // doesn't compile
for(auto i3 : c) { } // doesn't compile
for(auto i4 : d) { } // doesn't compile
for(auto i5 : e) { } // compiles!
}
What I'm saying is that I believe it's impossible to write something in=20
normal C++ that has equivalent behavior (fail on types like A/B/C/D but=20
succeed on types like E).
>
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_280_698935999.1442090699130
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br>On Saturday, September 12, 2015 at 4:24:04 PM UTC-4, Klaim - Jo=C3=
=ABl Lamotte wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D=
"ltr"><br><div><div class=3D"gmail_quote"><div><br></div><div>If I understo=
od you correctly (I'm not sure), this is already what std::begin does: =
<a href=3D"http://en.cppreference.com/w/cpp/iterator/begin" target=3D"_blan=
k" rel=3D"nofollow" onmousedown=3D"this.href=3D'http://www.google.com/u=
rl?q\75http%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Fiterator%2Fbegin\46sa\7=
5D\46sntz\0751\46usg\75AFQjCNGlEjxx91ToOE8bgKWyRaUzinoUCA';return true;=
" onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fen=
..cppreference.com%2Fw%2Fcpp%2Fiterator%2Fbegin\46sa\75D\46sntz\0751\46usg\7=
5AFQjCNGlEjxx91ToOE8bgKWyRaUzinoUCA';return true;">http://en.cppreferen=
ce.com/w/<wbr>cpp/iterator/begin</a></div><div>Although you need to use a u=
sing namespace declaration to benefit from ADL:</div><div><br></div><div>te=
mplate< class Container ></div><div>void foo( Container&& con=
tainer )</div><div>{</div><div>=C2=A0 =C2=A0 =C2=A0using namespace std; // =
allow to use std::begin if no Container's namespace specific begin() fu=
nction is provided</div><div>=C2=A0 =C2=A0 =C2=A0auto&& it =3D begi=
n(container); // if no other option than std::begin() is selected here, if =
container.begin() exists, use it, otherwise fails to compile.</div><div>=C2=
=A0 =C2=A0 =C2=A0...</div><div>}</div></div></div></div></blockquote><div><=
br></div><div>... and you fell into one of the subtle traps here. You can&#=
39;t use an overload set containing both `std::begin` and a `begin` found b=
y ADL, because the latter can be equally greedy (think something like boost=
::begin - though they added an ADL barrier for that) and - voila - you get =
an ambiguous call. See also http://www.open-std.org/jtc1/sc22/wg21/docs/pap=
ers/2011/n3257.pdf.</div><div><br></div><div>Here's an example of what =
I mean:</div><div><br></div><div class=3D"prettyprint" style=3D"border: 1px=
solid rgb(187, 187, 187); word-wrap: break-word; background-color: rgb(250=
, 250, 250);"><code class=3D"prettyprint"><div class=3D"subprettyprint"><sp=
an style=3D"color: #008;" class=3D"styled-by-prettify">namespace</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> foo </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> A </span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">int</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">begin</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an 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><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> B </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">using</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">end</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">int</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: #6=
60;" class=3D"styled-by-prettify">};</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">class</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> C </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">int</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: #008;" class=3D"styled-by-prettify">begin</span><span s=
tyle=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">int</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">*</span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">end</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">();</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">};</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #800;" class=3D"styled-by-prettify">// inaccessible</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">struct</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> D </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">int</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">begin</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">int</spa=
n><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">int</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">*</span><font color=3D"#000000"><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">end</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">();</span></font><span style=3D"color: #=
660;" class=3D"styled-by-prettify">};</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">struct</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> E </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{};</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">template</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify"><</span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">class</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> T</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">></span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">int</sp=
an><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">begin</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">const</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> T</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&)</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">return</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">nullptr</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">template</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify"><</span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">class</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> T</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">></span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">int</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: #008;" class=3D"styled-by-prettify">end</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">const</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> T</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">&)</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #008;" class=3D"styled-by-prettify">return</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">nullptr</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: #660;" class=3D=
"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">int</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> main</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 foo</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">A a</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> foo</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify">B b</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;<=
/span><font color=3D"#000000"><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> foo</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">C=
c</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> foo</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify">D d</span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> foo</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">E e</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">for</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> i1 </span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> a</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: #660;" class=3D=
"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #800;" class=3D"styled-by-prettify">// doesn't =
compile</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
></span></font><span style=3D"color: #000;" class=3D"styled-by-prettify">=
=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">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: #000;" class=3D"styled-by-prettify"> i2 </span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> b</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">}<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: rgb(136, 0, 0);"><span style=3D"color: #800;" class=3D"s=
tyled-by-prettify">// doesn't compile</span></span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">for</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> i3 </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">:</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> c</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: rgb(136, 0, 0=
);"><span style=3D"color: #800;" class=3D"styled-by-prettify">// doesn'=
t compile</span></span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled=
-by-prettify">for</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">au=
to</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> i4 </sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> d</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: rgb(136, 0, 0);"><span style=3D"color: #800;" =
class=3D"styled-by-prettify">// doesn't compile</span></span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">for</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> i5 </span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> e</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: rgb(=
136, 0, 0);"><span style=3D"color: #800;" class=3D"styled-by-prettify">// c=
ompiles!</span></span><font color=3D"#000000"><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"style=
d-by-prettify"><br></span></font></div></code></div><div><br></div><div><br=
></div><div>What I'm saying is that I believe it's impossible to wr=
ite something in normal C++ that has equivalent behavior (fail on types lik=
e A/B/C/D but succeed on types like E).</div><blockquote class=3D"gmail_quo=
te" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;paddi=
ng-left: 1ex;">
</blockquote>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_280_698935999.1442090699130--
------=_Part_279_1469783035.1442090699128--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Sat, 12 Sep 2015 23:47:50 +0200
Raw View
--001a11c3be58aa88d0051f93c8f4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On 12 September 2015 at 22:44, T. C. <rs2740@gmail.com> wrote:
>
>
> On Saturday, September 12, 2015 at 4:24:04 PM UTC-4, Klaim - Jo=C3=ABl La=
motte
> wrote:
>>
>>
>>
>> If I understood you correctly (I'm not sure), this is already what
>> std::begin does: http://en.cppreference.com/w/cpp/iterator/begin
>> Although you need to use a using namespace declaration to benefit from
>> ADL:
>>
>> template< class Container >
>> void foo( Container&& container )
>> {
>> using namespace std; // allow to use std::begin if no Container's
>> namespace specific begin() function is provided
>> auto&& it =3D begin(container); // if no other option than
>> std::begin() is selected here, if container.begin() exists, use it,
>> otherwise fails to compile.
>> ...
>> }
>>
>
> ... and you fell into one of the subtle traps here. You can't use an
> overload set containing both `std::begin` and a `begin` found by ADL,
> because the latter can be equally greedy (think something like boost::beg=
in
> - though they added an ADL barrier for that) and - voila - you get an
> ambiguous call. See also
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3257.pdf.
>
> Here's an example of what I mean:
>
> namespace foo {
> struct A { int begin; };
> struct B { using end =3D int; };
> class C { int* begin(); int *end(); }; // inaccessible
> struct D { int* begin(int); int* end();};
> struct E {};
>
> template<class T> int* begin(const T&) { return nullptr; }
> template<class T> int* end(const T&) { return nullptr; }
> }
>
> int main() {
> foo::A a; foo::B b; foo::C c; foo::D d; foo::E e;
> for(auto i1 : a) { } // doesn't compile
> for(auto i2 : b) { } // doesn't compile
> for(auto i3 : c) { } // doesn't compile
> for(auto i4 : d) { } // doesn't compile
> for(auto i5 : e) { } // compiles!
> }
>
>
> What I'm saying is that I believe it's impossible to write something in
> normal C++ that has equivalent behavior (fail on types like A/B/C/D but
> succeed on types like E).
>
>>
>
I was right thinking I certainly misunderstood. Thanks for the
clarification.
By the way, is the "customization points" proposal from Eric Niebler a
potential solution for this?
My understanding is not totally complete on these subjects.
--=20
---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
--001a11c3be58aa88d0051f93c8f4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 12 September 2015 at 22:44, T. C. <span dir=3D"ltr"><<a href=3D"m=
ailto:rs2740@gmail.com" target=3D"_blank">rs2740@gmail.com</a>></span> w=
rote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><span class=3D""><br><br>On Saturda=
y, September 12, 2015 at 4:24:04 PM UTC-4, Klaim - Jo=C3=ABl Lamotte wrote:=
<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div><div clas=
s=3D"gmail_quote"><div><br></div><div>If I understood you correctly (I'=
m not sure), this is already what std::begin does: <a href=3D"http://en.cpp=
reference.com/w/cpp/iterator/begin" rel=3D"nofollow" target=3D"_blank">http=
://en.cppreference.com/w/cpp/iterator/begin</a></div><div>Although you need=
to use a using namespace declaration to benefit from ADL:</div><div><br></=
div><div>template< class Container ></div><div>void foo( Container&am=
p;& container )</div><div>{</div><div>=C2=A0 =C2=A0 =C2=A0using namespa=
ce std; // allow to use std::begin if no Container's namespace specific=
begin() function is provided</div><div>=C2=A0 =C2=A0 =C2=A0auto&& =
it =3D begin(container); // if no other option than std::begin() is selecte=
d here, if container.begin() exists, use it, otherwise fails to compile.</d=
iv><div>=C2=A0 =C2=A0 =C2=A0...</div><div>}</div></div></div></div></blockq=
uote><div><br></div></span><div>... and you fell into one of the subtle tra=
ps here. You can't use an overload set containing both `std::begin` and=
a `begin` found by ADL, because the latter can be equally greedy (think so=
mething like boost::begin - though they added an ADL barrier for that) and =
- voila - you get an ambiguous call. See also <a href=3D"http://www.open-st=
d.org/jtc1/sc22/wg21/docs/papers/2011/n3257.pdf" target=3D"_blank">http://w=
ww.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3257.pdf</a>.</div><div><b=
r></div><div>Here's an example of what I mean:</div><div><br></div><div=
style=3D"border:1px solid rgb(187,187,187);word-wrap:break-word;background=
-color:rgb(250,250,250)"><code><div><span style=3D"color:#008">namespace</s=
pan><span style=3D"color:#000"> foo </span><span style=3D"color:#660">{</sp=
an><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color=
:#008">struct</span><span style=3D"color:#000"> A </span><span style=3D"col=
or:#660">{</span><span style=3D"color:#000"> </span><span style=3D"color:#0=
08">int</span><span style=3D"color:#000"> </span><span style=3D"color:#008"=
>begin</span><span style=3D"color:#660">;</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:#008">struct</span><span style=
=3D"color:#000"> B </span><span style=3D"color:#660">{</span><span style=3D=
"color:#000"> </span><span style=3D"color:#008">using</span><span style=3D"=
color:#000"> </span><span style=3D"color:#008">end</span><span style=3D"col=
or:#000"> </span><span style=3D"color:#660">=3D</span><span style=3D"color:=
#000"> </span><span style=3D"color:#008">int</span><span style=3D"color:#66=
0">;</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"c=
olor:#008">class</span><span style=3D"color:#000"> C </span><span style=3D"=
color:#660">{</span><span style=3D"color:#000"> </span><span style=3D"color=
:#008">int</span><span style=3D"color:#660">*</span><span style=3D"color:#0=
00"> </span><span style=3D"color:#008">begin</span><span style=3D"color:#66=
0">();</span><span style=3D"color:#000"> </span><span style=3D"color:#008">=
int</span><span style=3D"color:#000"> </span><span style=3D"color:#660">*</=
span><span style=3D"color:#008">end</span><span style=3D"color:#660">();</s=
pan><span style=3D"color:#000"> </span><span style=3D"color:#660">};</span>=
<span style=3D"color:#000"> </span><span style=3D"color:#800">// inaccessib=
le</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D=
"color:#008">struct</span><span style=3D"color:#000"> D </span><span style=
=3D"color:#660">{</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#008">int</span><span style=3D"color:#660">*</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#008">begin</span><span style=3D"color=
:#660">(</span><span style=3D"color:#008">int</span><span style=3D"color:#6=
60">);</span><span style=3D"color:#000"> </span><span style=3D"color:#008">=
int</span><span style=3D"color:#660">*</span><font color=3D"#000000"><span =
style=3D"color:#000"> </span><span style=3D"color:#008">end</span><span sty=
le=3D"color:#660">();</span></font><span style=3D"color:#660">};</span><spa=
n style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#008">=
struct</span><span style=3D"color:#000"> E </span><span style=3D"color:#660=
">{};</span><span style=3D"color:#000"><br><br>=C2=A0 =C2=A0 </span><span s=
tyle=3D"color:#008">template</span><span style=3D"color:#660"><</span><s=
pan style=3D"color:#008">class</span><span style=3D"color:#000"> T</span><s=
pan style=3D"color:#660">></span><span style=3D"color:#000"> </span><spa=
n style=3D"color:#008">int</span><span style=3D"color:#660">*</span><span s=
tyle=3D"color:#000"> </span><span style=3D"color:#008">begin</span><span st=
yle=3D"color:#660">(</span><span style=3D"color:#008">const</span><span sty=
le=3D"color:#000"> T</span><span style=3D"color:#660">&)</span><span st=
yle=3D"color:#000"> </span><span style=3D"color:#660">{</span><span style=
=3D"color:#000"> </span><span style=3D"color:#008">return</span><span style=
=3D"color:#000"> </span><span style=3D"color:#008">nullptr</span><span styl=
e=3D"color:#660">;</span><span style=3D"color:#000"> </span><span style=3D"=
color:#660">}</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><sp=
an style=3D"color:#008">template</span><span style=3D"color:#660"><</spa=
n><span style=3D"color:#008">class</span><span style=3D"color:#000"> T</spa=
n><span style=3D"color:#660">></span><span style=3D"color:#000"> </span>=
<span style=3D"color:#008">int</span><span style=3D"color:#660">*</span><sp=
an style=3D"color:#000"> </span><span style=3D"color:#008">end</span><span =
style=3D"color:#660">(</span><span style=3D"color:#008">const</span><span s=
tyle=3D"color:#000"> T</span><span style=3D"color:#660">&)</span><span =
style=3D"color:#000"> </span><span style=3D"color:#660">{</span><span style=
=3D"color:#000"> </span><span style=3D"color:#008">return</span><span style=
=3D"color:#000"> </span><span style=3D"color:#008">nullptr</span><span styl=
e=3D"color:#660">;</span><span style=3D"color:#000"> </span><span style=3D"=
color:#660">}</span><span style=3D"color:#000"><br></span><span style=3D"co=
lor:#660">}</span><span style=3D"color:#000"><br><br></span><span style=3D"=
color:#008">int</span><span style=3D"color:#000"> main</span><span style=3D=
"color:#660">()</span><span style=3D"color:#000"> </span><span style=3D"col=
or:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 foo</span><sp=
an style=3D"color:#660">::</span><span style=3D"color:#000">A a</span><span=
style=3D"color:#660">;</span><span style=3D"color:#000"> foo</span><span s=
tyle=3D"color:#660">::</span><span style=3D"color:#000">B b</span><span sty=
le=3D"color:#660">;</span><font color=3D"#000000"><span style=3D"color:#000=
"> foo</span><span style=3D"color:#660">::</span><span style=3D"color:#000"=
>C c</span><span style=3D"color:#660">;</span><span style=3D"color:#000"> f=
oo</span><span style=3D"color:#660">::</span><span style=3D"color:#000">D d=
</span><span style=3D"color:#660">;</span><span style=3D"color:#000"> foo</=
span><span style=3D"color:#660">::</span><span style=3D"color:#000">E e</sp=
an><span style=3D"color:#660">;</span><span style=3D"color:#000"><br>=C2=A0=
=C2=A0 </span><span style=3D"color:#008">for</span><span style=3D"color:#6=
60">(</span><span style=3D"color:#008">auto</span><span style=3D"color:#000=
"> i1 </span><span style=3D"color:#660">:</span><span style=3D"color:#000">=
a</span><span style=3D"color:#660">)</span><span style=3D"color:#000"> </s=
pan><span style=3D"color:#660">{</span><span style=3D"color:#000"> </span><=
span style=3D"color:#660">}</span><span style=3D"color:#000"> </span><span =
style=3D"color:#800">// doesn't compile</span><span style=3D"color:#000=
"><br></span></font><span style=3D"color:#000">=C2=A0 =C2=A0 </span><span s=
tyle=3D"color:#008">for</span><span style=3D"color:#660">(</span><span styl=
e=3D"color:#008">auto</span><span style=3D"color:#000"> i2 </span><span sty=
le=3D"color:#660">:</span><span style=3D"color:#000"> b</span><span style=
=3D"color:#660">)</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#660">{</span><span style=3D"color:#000"> </span><span style=3D"color:=
#660">}</span><span style=3D"color:#000"> </span><span style=3D"color:rgb(1=
36,0,0)"><span style=3D"color:#800">// doesn't compile</span></span><sp=
an style=3D"color:#000"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#008"=
>for</span><span style=3D"color:#660">(</span><span style=3D"color:#008">au=
to</span><span style=3D"color:#000"> i3 </span><span style=3D"color:#660">:=
</span><span style=3D"color:#000"> c</span><span style=3D"color:#660">)</sp=
an><span style=3D"color:#000"> </span><span style=3D"color:#660">{</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#660">}</span><span s=
tyle=3D"color:#000"> </span><span style=3D"color:rgb(136,0,0)"><span style=
=3D"color:#800">// doesn't compile</span></span><span style=3D"color:#0=
00"><br>=C2=A0 =C2=A0 </span><span style=3D"color:#008">for</span><span sty=
le=3D"color:#660">(</span><span style=3D"color:#008">auto</span><span style=
=3D"color:#000"> i4 </span><span style=3D"color:#660">:</span><span style=
=3D"color:#000"> d</span><span style=3D"color:#660">)</span><span style=3D"=
color:#000"> </span><span style=3D"color:#660">{</span><span style=3D"color=
:#000"> </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">// =
doesn't compile</span></span><span style=3D"color:#000"><br>=C2=A0 =C2=
=A0 </span><span style=3D"color:#008">for</span><span style=3D"color:#660">=
(</span><span style=3D"color:#008">auto</span><span style=3D"color:#000"> i=
5 </span><span style=3D"color:#660">:</span><span style=3D"color:#000"> e</=
span><span style=3D"color:#660">)</span><span style=3D"color:#000"> </span>=
<span style=3D"color:#660">{</span><span style=3D"color:#000"> </span><span=
style=3D"color:#660">}</span><span style=3D"color:#000"> </span><span styl=
e=3D"color:rgb(136,0,0)"><span style=3D"color:#800">// compiles!</span></sp=
an><font color=3D"#000000"><span style=3D"color:#000"><br></span><span styl=
e=3D"color:#660">}</span><span style=3D"color:#000"><br></span></font></div=
></code></div><div><br></div><div><br></div><div>What I'm saying is tha=
t I believe it's impossible to write something in normal C++ that has e=
quivalent behavior (fail on types like A/B/C/D but succeed on types like E)=
..</div><div class=3D"HOEnZb"><div class=3D"h5"><blockquote class=3D"gmail_q=
uote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;paddin=
g-left:1ex">
</blockquote>
<p></p><br></div></div></blockquote><div><br></div><div>I was right thinkin=
g I certainly misunderstood. Thanks for the clarification.</div><div>By the=
way, is the "customization points" proposal from Eric Niebler a =
potential solution for this?=C2=A0</div><div>My understanding is not totall=
y complete on these subjects.</div><div><br></div><div>=C2=A0</div></div></=
div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c3be58aa88d0051f93c8f4--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Thu, 17 Sep 2015 10:12:27 -0700 (PDT)
Raw View
------=_Part_1172_565772023.1442509947311
Content-Type: text/plain; charset=UTF-8
Would it not be better to have something along the lines of the following:
template<typename F, typename T...>
// requires F to be callable with all Ts as parameters
void for_each(T&& t..., F&& fn)
{
auto ranges = make_multirange(forward(t)...);
for(;ranges.current() != ranges.end(); ++ranges)
{
fn(ranges.get<>()...);
}
}
I know this kind of thing is not currently possible but this would seem the best approach and also allow other useful possibilities too. This code is assuming a tuple-like type for the collection of ranges.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_1172_565772023.1442509947311--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Sat, 19 Sep 2015 00:46:58 +0200
Raw View
--001a11c32bd633448905200d4fe2
Content-Type: text/plain; charset=UTF-8
On 17 September 2015 at 19:12, Izzy Coding <matthew.i.greenwood@gmail.com>
wrote:
> Would it not be better to have something along the lines of the following:
>
> template<typename F, typename T...>
> // requires F to be callable with all Ts as parameters
> void for_each(T&& t..., F&& fn)
> {
> auto ranges = make_multirange(forward(t)...);
> for(;ranges.current() != ranges.end(); ++ranges)
> {
> fn(ranges.get<>()...);
> }
> }
>
> I know this kind of thing is not currently possible but this would seem
> the best approach and also allow other useful possibilities too. This code
> is assuming a tuple-like type for the collection of ranges.
>
>
It would be best if there was not the current for_each() overloads yes.
Unfortunately, even with a new stl version, there would still be a need for
for_each() overloads taking a pair of iterators, which mean still the same
problem, except if you use concepts to define iterator's concept.
If I'm following correctly.
That's the main reason I provided a working example which don't conflict
with the current signatures: a note could be added that such a signature
would be nice but then would be
dependent on concept TS/proposals which add a dependence on this proposal
so should not be mandatory.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
--001a11c32bd633448905200d4fe2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On 17 September 2015 at 19:12, Izzy Coding <span dir=3D"ltr"><<a hre=
f=3D"mailto:matthew.i.greenwood@gmail.com" target=3D"_blank">matthew.i.gree=
nwood@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Wou=
ld it not be better to have something along the lines of the following:<br>
<br>
template<typename F, typename T...><br>
// requires F to be callable with all Ts as parameters<br>
void for_each(T&& t..., F&& fn)<br>
{<br>
=C2=A0 =C2=A0 auto ranges =3D make_multirange(forward(t)...);<br>
=C2=A0 =C2=A0 for(;ranges.current() !=3D ranges.end(); ++ranges)<br>
=C2=A0 =C2=A0 {<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fn(ranges.get<>()...);<br>
=C2=A0 =C2=A0 }<br>
}<br>
<br>
I know this kind of thing is not currently possible but this would seem the=
best approach and also allow other useful possibilities too. This code is =
assuming a tuple-like type for the collection of ranges.<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br></div></div></blockquote><div><=
br></div><div>It would be best if there was not the current for_each() over=
loads yes.</div><div>Unfortunately, even with a new stl version, there woul=
d still be a need for for_each() overloads taking a pair of iterators, whic=
h mean still the same problem, except if you use concepts to define iterato=
r's concept.</div><div>If I'm following correctly.</div><div>That&#=
39;s the main reason I provided a working example which don't conflict =
with the current signatures: a note could be added that such a signature wo=
uld be nice but then would be=C2=A0</div><div>dependent on concept TS/propo=
sals which add a dependence on this proposal so should not be mandatory.</d=
iv><div><br></div></div></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c32bd633448905200d4fe2--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Sat, 19 Sep 2015 08:46:57 -0700 (PDT)
Raw View
------=_Part_3188_1783795667.1442677617844
Content-Type: multipart/alternative;
boundary="----=_Part_3189_778303989.1442677617844"
------=_Part_3189_778303989.1442677617844
Content-Type: text/plain; charset=UTF-8
I was essentially thinking this in addition to the existing for_each
definitions.
The assumption of dependacy on concepts is correct and would be needed for
this ability as you have suggested.
I was merely suggesting what the ideal solution might look like given other
changes in the standard that are currently not available.
For example I dont think the "ranges.get<>()..." is currently possible to
expand out all the items of a tuple like object?
Also I did not specify exactly what the "make_multirange" function does. I
guess in reality it could be down to that function to be specialised based
on the T's that are passed. I only called it "make_multirange" to
illustrate the focus of this current proposal. I assume it would actually
be named differently in order to accept various differing range
specifications.
The only current options I currently know of however are:
1. iterators begin() and end()
2. ranges (as defined in the ranges proposal)
3. and the new multi ranges which essentially could be a variable list
of types that expose a begin() and end() member.
ultimatley they would all be wrapped into an STL type that exibhits the
required interface to the values passed in for the "for" statement to
execute correctly.
Anything that is unable to be implemented within the wrapper type would be
classed as invalid code.
I hope that all makes sense? I know my descriptive ability leave a fare bit
to be desired. LOL
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_3189_778303989.1442677617844
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>I was essentially thinking this in addition to the exi=
sting for_each definitions.<br>The assumption of dependacy on concepts is c=
orrect and would be needed for this ability as you have suggested.<br>I was=
merely suggesting what the ideal solution might look like given other chan=
ges in the standard that are currently not available.<br>For example I dont=
think the "ranges.get<>()..." is currently possible to exp=
and out all the items of a tuple like object?<br>Also I did not specify exa=
ctly what the "make_multirange" function does. I guess in reality=
it could be down to that function to be specialised based on the T's t=
hat are passed. I only called it "make_multirange" to illustrate =
the focus of this current proposal. I assume it would actually be named dif=
ferently in order to accept various differing range specifications.<br>The =
only current options I currently know of however are:<br><ol><li>iterators =
begin() and end()</li><li>ranges (as defined in the ranges proposal)</li><l=
i>and the new multi ranges which essentially could be a variable list of ty=
pes that expose a begin() and end() member.</li></ol><p>ultimatley they wou=
ld all be wrapped into an STL type that exibhits the required interface to =
the values passed in for the "for" statement to execute correctly=
..</p><p>Anything that is unable to be implemented within the wrapper type w=
ould be classed as invalid code.</p><p><br></p><p>I hope that all makes sen=
se? I know my descriptive ability leave a fare bit to be desired. LOL<br></=
p><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_3189_778303989.1442677617844--
------=_Part_3188_1783795667.1442677617844--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Mon, 21 Sep 2015 03:06:19 -0700 (PDT)
Raw View
------=_Part_253_1196822458.1442829979592
Content-Type: text/plain; charset=UTF-8
Hopefully the last draft of the proposal.
I hope these additions will help to spark more debate about the possible library implementation of multi-range based loops.
The latest version can be found here:
https://drive.google.com/open?id=0B26UZ0CbMay5dnZrWU5mcW9ZTFU
As always all comments and suggestions are welcome.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_253_1196822458.1442829979592--
.
Author: denisx9.0c@gmail.com
Date: Thu, 4 Oct 2018 13:16:14 -0700 (PDT)
Raw View
------=_Part_462_589105386.1538684174457
Content-Type: text/plain; charset="UTF-8"
Hi, Are there any updates on this proposal?
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/565dba81-d9a3-4943-a842-3916b4f56370%40isocpp.org.
------=_Part_462_589105386.1538684174457--
.
Author: denisx9.0c@gmail.com
Date: Thu, 4 Oct 2018 13:25:21 -0700 (PDT)
Raw View
------=_Part_472_1058966063.1538684721871
Content-Type: text/plain; charset="UTF-8"
It should be more important since parallel algorithms were introduced, because if I want to perform some operation on several arrays simultaneously I cannot do it at the moment.
Moreover, it could replace transform function that take two arrays as input with more general solution.
--
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/c1a1139c-47d9-47bc-873a-137afea74dad%40isocpp.org.
------=_Part_472_1058966063.1538684721871--
.
Author: Izzy Coding <matthew.i.greenwood@gmail.com>
Date: Thu, 4 Oct 2018 23:25:43 -0700 (PDT)
Raw View
------=_Part_632_1556745375.1538720743828
Content-Type: text/plain; charset="UTF-8"
At present this proposal was discussed and went on the mailing list, but was apparently dismissed.
I was unable to attend the standards meeting, so I am not exactly sure what happened. The most I can gather is that it was not accepted because the ranges proposal would offer the same or similar ability.
I am however, still open to comments and any arguments and examples to help support this proposal.
Also, I am still interested in help to get a good library implementation of this together.
If there was a standards meeting in England it would be easier for me to attend. Other than that I am also looking for someone who can attend the meetings and champion this proposal on my behalf.
--
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/8b446b1b-5944-4a3f-b899-f88604c41612%40isocpp.org.
------=_Part_632_1556745375.1538720743828--
.
Author: =?UTF-8?Q?Klaim_=2D_Jo=C3=ABl_Lamotte?= <mjklaim@gmail.com>
Date: Fri, 5 Oct 2018 11:39:27 +0200
Raw View
You might want to contact Micheal Wong, if I remember correctly he
manages the group in england, which would be a good place to find help
on that.
On Fri, 5 Oct 2018 at 08:25, Izzy Coding <matthew.i.greenwood@gmail.com> wrote:
>
> At present this proposal was discussed and went on the mailing list, but was apparently dismissed.
> I was unable to attend the standards meeting, so I am not exactly sure what happened. The most I can gather is that it was not accepted because the ranges proposal would offer the same or similar ability.
> I am however, still open to comments and any arguments and examples to help support this proposal.
> Also, I am still interested in help to get a good library implementation of this together.
> If there was a standards meeting in England it would be easier for me to attend. Other than that I am also looking for someone who can attend the meetings and champion this proposal on my behalf.
>
> --
> 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/8b446b1b-5944-4a3f-b899-f88604c41612%40isocpp.org.
--
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/CAOU91OPSV0LWyteaZDD%2BSDCgFQ2ycsPxKc%3DzuxEP_EVreXbcfw%40mail.gmail.com.
.