Topic: For Loop Exit Strategies
Author: "R. Martinho Fernandes" <martinho.fernandes@gmail.com>
Date: Wed, 3 Apr 2013 12:03:14 -0700 (PDT)
Raw View
------=_Part_93_4047307.1365015794043
Content-Type: text/plain; charset=ISO-8859-1
I might be missing something here. Is there a use case for the syntactic
construct proposed in N3587<http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3587.pdf>that isn't covered by std::find_if? Or in other words, is there any use for
this besides reinventing std::find_if?
--
---
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/?hl=en.
------=_Part_93_4047307.1365015794043
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I might be missing something here. Is there a use case for the syntactic co=
nstruct proposed in<a href=3D"http://www.open-std.org/JTC1/SC22/WG21/docs/p=
apers/2013/n3587.pdf"> N3587</a> that isn't covered by std::find_if? Or in =
other words, is there any use for this besides reinventing std::find_if?<br=
>
<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_93_4047307.1365015794043--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Wed, 3 Apr 2013 17:41:36 -0700 (PDT)
Raw View
------=_Part_407_4360239.1365036096717
Content-Type: text/plain; charset=ISO-8859-1
On Wednesday, April 3, 2013 12:03:14 PM UTC-7, R. Martinho Fernandes wrote:
>
> I might be missing something here. Is there a use case for the syntactic
> construct proposed in N3587<http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3587.pdf>that isn't covered by std::find_if? Or in other words, is there any use for
> this besides reinventing std::find_if?
>
The proposed syntax is applicable to any for loop. `find_if` is only
applicable to a for loop over a range.
Personally, I think it's a terrible idea on its merits. The suggested
syntax can retroactively break existing code (any code that uses a `{}`
block immediately after a for-loop). And the problem it solves is really
not that important.
--
---
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/?hl=en.
------=_Part_407_4360239.1365036096717
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Wednesday, April 3, 2013 12:03:14 PM UTC-7, R. Martinho Fernandes wrote:=
<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bor=
der-left: 1px #ccc solid;padding-left: 1ex;">I might be missing something h=
ere. Is there a use case for the syntactic construct proposed in<a href=3D"=
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3587.pdf" target=
=3D"_blank"> N3587</a> that isn't covered by std::find_if? Or in other word=
s, is there any use for this besides reinventing std::find_if?<br></blockqu=
ote><div><br>The proposed syntax is applicable to any for loop. `find_if` i=
s only applicable to a for loop over a range.<br><br>Personally, I think it=
's a terrible idea on its merits. The suggested syntax can retroactively br=
eak existing code (any code that uses a `{}` block immediately after a for-=
loop). And the problem it solves is really not that important.<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_407_4360239.1365036096717--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Wed, 3 Apr 2013 17:42:07 -0700 (PDT)
Raw View
------=_Part_412_30587227.1365036127674
Content-Type: text/plain; charset=ISO-8859-1
On Wednesday, April 3, 2013 5:41:36 PM UTC-7, Nicol Bolas wrote:
>
> On Wednesday, April 3, 2013 12:03:14 PM UTC-7, R. Martinho Fernandes wrote:
>>
>> I might be missing something here. Is there a use case for the syntactic
>> construct proposed in N3587<http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3587.pdf>that isn't covered by std::find_if? Or in other words, is there any use for
>> this besides reinventing std::find_if?
>>
>
> The proposed syntax is applicable to any for loop. `find_if` is only
> applicable to a for loop over a range.
>
> Personally, I think it's a terrible idea on its merits. The suggested
> syntax can retroactively break existing code (any code that uses a `{}`
> block immediately after a for-loop). And the problem it solves is really
> not that important.
>
Oops, nevermind the syntax thing. I missed the `if` at the beginning.
--
---
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/?hl=en.
------=_Part_412_30587227.1365036127674
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><br>On Wednesday, April 3, 2013 5:41:36 PM UTC-7, Nicol Bolas wrote:<bl=
ockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border=
-left: 1px #ccc solid;padding-left: 1ex;">On Wednesday, April 3, 2013 12:03=
:14 PM UTC-7, R. Martinho Fernandes wrote:<blockquote class=3D"gmail_quote"=
style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">I might be missing something here. Is there a use case for the synta=
ctic construct proposed in<a href=3D"http://www.open-std.org/JTC1/SC22/WG21=
/docs/papers/2013/n3587.pdf" target=3D"_blank"> N3587</a> that isn't covere=
d by std::find_if? Or in other words, is there any use for this besides rei=
nventing std::find_if?<br></blockquote><div><br>The proposed syntax is appl=
icable to any for loop. `find_if` is only applicable to a for loop over a r=
ange.<br><br>Personally, I think it's a terrible idea on its merits. The su=
ggested syntax can retroactively break existing code (any code that uses a =
`{}` block immediately after a for-loop). And the problem it solves is real=
ly not that important.<br></div></blockquote><div><br>Oops, nevermind the s=
yntax thing. I missed the `if` at the beginning. <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_412_30587227.1365036127674--
.
Author: Benjamin Lindley <benjameslindley@gmail.com>
Date: Wed, 3 Apr 2013 20:37:29 -0700 (PDT)
Raw View
------=_Part_245_33286599.1365046649774
Content-Type: text/plain; charset=ISO-8859-1
On Wednesday, April 3, 2013 2:03:14 PM UTC-5, R. Martinho Fernandes wrote:
>
> I might be missing something here. Is there a use case for the syntactic
> construct proposed in N3587<http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3587.pdf>that isn't covered by std::find_if? Or in other words, is there any use for
> this besides reinventing std::find_if?
>
find_if doesn't allow the predicate to modify the object, as per 25.1/8.
....The function object pred shall not apply any non-constant function
> through the dereferenced iterator.
>
A for loop has no such restriction.
--
---
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/?hl=en.
------=_Part_245_33286599.1365046649774
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<br><br>On Wednesday, April 3, 2013 2:03:14 PM UTC-5, R. Martinho Fernandes=
wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.=
8ex;border-left: 1px #ccc solid;padding-left: 1ex;">I might be missing some=
thing here. Is there a use case for the syntactic construct proposed in<a h=
ref=3D"http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3587.pdf" t=
arget=3D"_blank"> N3587</a> that isn't covered by std::find_if? Or in other=
words, is there any use for this besides reinventing std::find_if?<br></bl=
ockquote><div><br>find_if doesn't allow the predicate to modify the object,=
as per 25.1/8.<br><br><blockquote style=3D"margin: 0px 0px 0px 0.8ex; bord=
er-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class=3D"gmail_q=
uote">...The function object pred shall not apply any non-constant function=
through the dereferenced iterator.<br></blockquote><div><br>A for loop has=
no such restriction. <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_245_33286599.1365046649774--
.