Topic: Questions on N3857 "Improvements to
Author: =?UTF-8?Q?Agust=c3=adn_K-ballo_Berg=c3=a9?= <kaballo86@hotmail.com>
Date: Tue, 8 Sep 2015 09:12:12 -0300
Raw View
On 9/8/2015 5:35 AM, Arthur O'Dwyer wrote:
> I keep finding newer and newer versions of this paper! If there's one
> out there which is newer than N3857
> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3857.pdf>
> (which supersedes N3784, which superseded N3721, which superseded N3634,
> which superseded N3558, which superseded N3428), please let me know. :)
This was later merged into the Concurrency TS Working Draft:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4538.pdf
> *(1)* In many places, N3857 talks about futures being "copied." This is
> just a colloquialism for "moved," right, since normal (non-shared)
> futures aren't copyable?
No, only `std::future`s are moved, `std::shared_future`s are copied. I=20
believe this was fixed long ago. The original proposal comes from a=20
place where only the equivalent of `std::shared_future`s exist, so these=20
crept in.
> *(2)* What should be the result of
>
> std::future<std::tuple<>> f =3D std::when_any(); // call the
> variadic-template version with zero arguments
Now `std::future<when_any_result<std::tuple<>>>` f =3D ...
> assert(f.valid()); // yes?
> assert(not f.ready()); // yes... or no?
> f.get(); // blocks forever... or throws std::broken_promise? ...or
> something else?
Yes, no, returns immediately. The returned future is immediately ready,=20
the `index` field of `when_any_result` holds `size_t(-1)`.
> The same question applies if you call the InputIterator version with a
> range of length zero.
Same answer.
> The same question applies to std::when_n, whenever /that/ gets proposed:
> what should be the result of std::when_n(10, f, g, h)? A future that
> becomes ready only when 10 of the 3 inputs have been satisfied, or a
> future that becomes ready as soon as /all/ 3 of the inputs have been
> satisfied?
I assume it would return once the 3 inputs have been satisfied, and the=20
`indices` field of the `when_n_result` would hold only 3 indices.
> *(3)* Incidentally, what's the history behind *is_ready()*'s name
> change? N3634 (2013-05-02) still had it as ready(), but by N3721
> (2013-08-30, after Chicago) it had somehow changed to is_ready(). The
> new name seems inconsistent with all the existing STL "adjective"
> accessors =E2=80=94 empty(), good(), bad(), valid(), etc.
At Issaquah, LEWG wanted to start naming all these `is_xxx` (this is a=20
bit unfortunate for `std::future` which already had `valid`). Then LWG=20
wanted to correct this to `ready` for consistency. I don't know what=20
happened next, it was either dropped or it fell through the cracks.
Regards,
--=20
Agust=C3=ADn K-ballo Berg=C3=A9.-
http://talesofcpp.fusionfenix.com
--=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: Tony V E <tvaneerd@gmail.com>
Date: Tue, 8 Sep 2015 14:48:15 -0400
Raw View
--001a11341a3410630e051f40cf2a
Content-Type: text/plain; charset=UTF-8
On Tue, Sep 8, 2015 at 4:35 AM, Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
wrote:
> I keep finding newer and newer versions of this paper! If there's one out
> there which is newer than N3857
> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3857.pdf>
> (which supersedes N3784, which superseded N3721, which superseded N3634,
> which superseded N3558, which superseded N3428), please let me know. :)
>
> I have at least three questions. #2 is the most important to me right now.
>
> *(2)* What should be the result of
>
> std::future<std::tuple<>> f = std::when_any(); // call the
> variadic-template version with zero arguments
> assert(f.valid()); // yes?
> assert(not f.ready()); // yes... or no?
> f.get(); // blocks forever... or throws std::broken_promise? ...or
> something else?
>
>
> The same question applies to std::when_n, whenever *that* gets proposed:
> what should be the result of std::when_n(10, f, g, h)? A future that
> becomes ready only when 10 of the 3 inputs have been satisfied, or a future
> that becomes ready as soon as *all* 3 of the inputs have been satisfied?
>
>
>
One possible bit of reasoning: what do you expect of when_all() for zero
args? They are all (ie the none of them) ready, so I think it should be
ready. (Or "there are none not ready".)
Now, do you expect when_any(X) to ever fail if when_all(X) succeeded?
Not sure what that says about when_n.
Tony
--
---
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/.
--001a11341a3410630e051f40cf2a
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 Tue, Sep 8, 2015 at 4:35 AM, Arthur O'Dwyer <span dir=3D"ltr">&l=
t;<a href=3D"mailto:arthur.j.odwyer@gmail.com" target=3D"_blank">arthur.j.o=
dwyer@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">I keep finding newer and newer versions of this paper! If the=
re's one out there which is newer than <a href=3D"http://www.open-std.o=
rg/jtc1/sc22/wg21/docs/papers/2014/n3857.pdf" target=3D"_blank">N3857</a> (=
which supersedes N3784, which superseded N3721, which superseded N3634, whi=
ch superseded N3558, which superseded N3428), please let me know. :)<div><b=
r></div><div>I have at least three questions. #2 is the most important to m=
e right now.</div><br><div><b>(2)</b> What should be the result of</div><di=
v><br></div><div><font face=3D"courier new, monospace">=C2=A0 =C2=A0 std::f=
uture<std::tuple<>> f =3D std::when_any(); =C2=A0// call the va=
riadic-template version with zero arguments</font></div><div><font face=3D"=
courier new, monospace">=C2=A0 =C2=A0 assert(f.valid()); =C2=A0// yes?</fon=
t></div><div><font face=3D"courier new, monospace">=C2=A0 =C2=A0 assert(not=
f.ready()); =C2=A0// yes... or no?</font></div><div><font face=3D"courier =
new, monospace">=C2=A0 =C2=A0 f.get(); =C2=A0// blocks forever... or throws=
std::broken_promise? ...or something else?</font></div><div><br></div><br>=
<div>The same question applies to <font face=3D"courier new, monospace">std=
::when_n</font>, whenever <i>that</i> gets proposed: what should be the res=
ult of <font face=3D"courier new, monospace">std::when_n(10, f, g, h)</font=
>? A future that becomes ready only when 10 of the 3 inputs have been satis=
fied, or a future that becomes ready as soon as <i>all</i>=C2=A03 of the in=
puts have been satisfied?</div><div><br></div><br></div></blockquote></div>=
<br></div><div class=3D"gmail_extra">One possible bit of reasoning: what do=
you expect of when_all() for zero args?=C2=A0 They are all (ie the none of=
them) ready, so I think it should be ready. (Or "there are none not r=
eady".)<br></div><div class=3D"gmail_extra">Now, do you expect when_an=
y(X) to ever fail if when_all(X) succeeded?<br><br></div><div class=3D"gmai=
l_extra">Not sure what that says about when_n.<br><br></div><div class=3D"g=
mail_extra">Tony<br><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 />
--001a11341a3410630e051f40cf2a--
.
Author: "Arthur O'Dwyer" <arthur.j.odwyer@gmail.com>
Date: Tue, 8 Sep 2015 22:27:00 -0700
Raw View
--e89a8f923a2068f672051f49bb3e
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Tue, Sep 8, 2015 at 11:48 AM, Tony V E <tvaneerd@gmail.com> wrote:
> On Tue, Sep 8, 2015 at 4:35 AM, Arthur O'Dwyer <arthur.j.odwyer@gmail.com=
>
> wrote:
>
>> I keep finding newer and newer versions of this paper! If there's one ou=
t
>> there which is newer than N3857
>> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3857.pdf>
>> (which supersedes N3784, which superseded N3721, which superseded N3634,
>> which superseded N3558, which superseded N3428), please let me know. :)
>>
>> I have at least three questions. #2 is the most important to me right no=
w.
>>
>> *(2)* What should be the result of
>>
>> std::future<std::tuple<>> f =3D std::when_any(); // call the
>> variadic-template version with zero arguments
>> assert(f.valid()); // yes?
>> assert(not f.ready()); // yes... or no?
>> f.get(); // blocks forever... or throws std::broken_promise? ...or
>> something else?
>>
>>
>> The same question applies to std::when_n, whenever *that* gets proposed:
>> what should be the result of std::when_n(10, f, g, h)? A future that
>> becomes ready only when 10 of the 3 inputs have been satisfied, or a fut=
ure
>> that becomes ready as soon as *all* 3 of the inputs have been satisfied?
>>
>
> One possible bit of reasoning: what do you expect of when_all() for zero
> args? They are all (ie the none of them) ready, so I think it should be
> ready. (Or "there are none not ready".)
>
Correct. All 0 of the 0 provided arguments are ready; therefore when_all()
returns a ready future.
> Now, do you expect when_any(X) to ever fail if when_all(X) succeeded?
>
Yes, naturally, in the case when X is the empty set.
None of the 0 provided arguments are ready; therefore when_any() strictly
ought to return an unready future.
http://math.stackexchange.com/questions/657931/why-negating-universal-quant=
ifier-gives-existential-quantifier
That is, I would naturally expect that
when_all(S).ready() iff =E2=88=80x=E2=88=88S : S.ready(),
and
when_any(S).ready() iff =E2=88=83x=E2=88=88S : S.ready().
Instead it looks like we have
when_all(S).ready() iff =E2=88=80x=E2=88=88S : S.ready(),
and
when_any(S).ready() iff S=3D=E2=88=85 =E2=88=A8 =E2=88=83x=E2=88=88S : S.=
ready().
I'm still curious about the rationale behind this choice; but for the
moment I'm happy to have found that it was a conscious decision (not an
oversight), and also to have learned about N4399.
The rationale probably comes down to something like "A future that's
always-unready can't possibly be useful, so anytime we'd make one of those,
let's make an always-ready future instead."
=E2=80=93Arthur
--=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/.
--e89a8f923a2068f672051f49bb3e
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Tue, Sep 8, 2015 at 11:48 AM, Tony V E <span dir=3D"ltr=
"><<a href=3D"mailto:tvaneerd@gmail.com" target=3D"_blank">tvaneerd@gmai=
l.com</a>></span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gma=
il_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-sty=
le:solid;padding-left:1ex"><div dir=3D"ltr">On Tue, Sep 8, 2015 at 4:35 AM,=
Arthur O'Dwyer <span dir=3D"ltr"><<a href=3D"mailto:arthur.j.odwyer=
@gmail.com" target=3D"_blank">arthur.j.odwyer@gmail.com</a>></span> wrot=
e:<br><div class=3D"gmail_extra"><div class=3D"gmail_quote"><blockquote cla=
ss=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 dir=3D"ltr"><span class=3D"">I keep finding newer and newer versions=
of this paper! If there's one out there which is newer than <a href=3D=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3857.pdf" target=
=3D"_blank">N3857</a> (which supersedes N3784, which superseded N3721, whic=
h superseded N3634, which superseded N3558, which superseded N3428), please=
let me know. :)<div><br></div><div>I have at least three questions. #2 is =
the most important to me right now.</div><br></span><span class=3D""><div><=
b>(2)</b> What should be the result of</div><div><br></div><div><font face=
=3D"courier new, monospace">=C2=A0 =C2=A0 std::future<std::tuple<>=
> f =3D std::when_any(); =C2=A0// call the variadic-template version wit=
h zero arguments</font></div><div><font face=3D"courier new, monospace">=C2=
=A0 =C2=A0 assert(f.valid()); =C2=A0// yes?</font></div><div><font face=3D"=
courier new, monospace">=C2=A0 =C2=A0 assert(not f.ready()); =C2=A0// yes..=
.. or no?</font></div><div><font face=3D"courier new, monospace">=C2=A0 =C2=
=A0 f.get(); =C2=A0// blocks forever... or throws std::broken_promise? ...o=
r something else?</font></div><div><br></div><br></span><span class=3D""><d=
iv>The same question applies to <font face=3D"courier new, monospace">std::=
when_n</font>, whenever <i>that</i> gets proposed: what should be the resul=
t of <font face=3D"courier new, monospace">std::when_n(10, f, g, h)</font>?=
A future that becomes ready only when 10 of the 3 inputs have been satisfi=
ed, or a future that becomes ready as soon as <i>all</i>=C2=A03 of the inpu=
ts have been satisfied?</div></span></div></blockquote></div><br></div><div=
class=3D"gmail_extra">One possible bit of reasoning: what do you expect of=
when_all() for zero args?=C2=A0 They are all (ie the none of them) ready, =
so I think it should be ready. (Or "there are none not ready".)<b=
r></div></div></blockquote><div><br></div><div>Correct. All 0 of the 0 prov=
ided arguments are ready; therefore when_all() returns a ready future.</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-=
left-style:solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_ext=
ra"></div><div class=3D"gmail_extra">Now, do you expect when_any(X) to ever=
fail if when_all(X) succeeded?<br></div></div></blockquote><div><br></div>=
<div>Yes, naturally, in the case when X is the empty set.</div><div>None of=
the 0 provided arguments are ready; therefore when_any() strictly ought to=
return an unready future.</div><div><a href=3D"http://math.stackexchange.c=
om/questions/657931/why-negating-universal-quantifier-gives-existential-qua=
ntifier">http://math.stackexchange.com/questions/657931/why-negating-univer=
sal-quantifier-gives-existential-quantifier<br></a></div><br>That is, I wou=
ld naturally expect that<br>when_all(S).ready() =C2=A0iff =C2=A0=E2=88=80x=
=E2=88=88S : S.ready(),<br>and<br>when_any(S).ready() =C2=A0iff =C2=A0=E2=
=88=83x=E2=88=88S : S.ready().</div><div class=3D"gmail_quote"><br></div><d=
iv class=3D"gmail_quote">Instead it looks like we have<br><div><br></div><d=
iv><div class=3D"gmail_quote">when_all(S).ready() =C2=A0iff =C2=A0=E2=88=80=
x=E2=88=88S : S.ready(),<br>and<br>when_any(S).ready() =C2=A0iff =C2=A0S=3D=
=E2=88=85 =E2=88=A8 =E2=88=83x=E2=88=88S : S.ready().</div></div><div><br><=
/div><div>I'm still curious about the rationale behind this choice; but=
for the moment I'm happy to have found that it was a conscious decisio=
n (not an oversight), and also to have learned about N4399.</div><div>The r=
ationale probably comes down to something like "A future that's al=
ways-unready can't possibly be useful, so anytime we'd make one of =
those, let's make an always-ready future instead."</div><div><br><=
/div><div>=E2=80=93Arthur</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 />
--e89a8f923a2068f672051f49bb3e--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Fri, 11 Sep 2015 18:59:22 -0400
Raw View
--001a11c3c8baa2bce2051f80aae4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wed, Sep 9, 2015 at 1:27 AM, Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
wrote:
> On Tue, Sep 8, 2015 at 11:48 AM, Tony V E <tvaneerd@gmail.com> wrote:
>
>> On Tue, Sep 8, 2015 at 4:35 AM, Arthur O'Dwyer <arthur.j.odwyer@gmail.co=
m
>> > wrote:
>>
>>> I keep finding newer and newer versions of this paper! If there's one
>>> out there which is newer than N3857
>>> <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3857.pdf>
>>> (which supersedes N3784, which superseded N3721, which superseded N3634=
,
>>> which superseded N3558, which superseded N3428), please let me know. :)
>>>
>>> I have at least three questions. #2 is the most important to me right
>>> now.
>>>
>>> *(2)* What should be the result of
>>>
>>> std::future<std::tuple<>> f =3D std::when_any(); // call the
>>> variadic-template version with zero arguments
>>> assert(f.valid()); // yes?
>>> assert(not f.ready()); // yes... or no?
>>> f.get(); // blocks forever... or throws std::broken_promise? ...or
>>> something else?
>>>
>>>
>>> The same question applies to std::when_n, whenever *that* gets
>>> proposed: what should be the result of std::when_n(10, f, g, h)? A
>>> future that becomes ready only when 10 of the 3 inputs have been satisf=
ied,
>>> or a future that becomes ready as soon as *all* 3 of the inputs have
>>> been satisfied?
>>>
>>
>> One possible bit of reasoning: what do you expect of when_all() for zero
>> args? They are all (ie the none of them) ready, so I think it should be
>> ready. (Or "there are none not ready".)
>>
>
> Correct. All 0 of the 0 provided arguments are ready; therefore when_all(=
)
> returns a ready future.
>
>
>> Now, do you expect when_any(X) to ever fail if when_all(X) succeeded?
>>
>
> Yes, naturally, in the case when X is the empty set.
> None of the 0 provided arguments are ready; therefore when_any() strictly
> ought to return an unready future.
>
> http://math.stackexchange.com/questions/657931/why-negating-universal-qua=
ntifier-gives-existential-quantifier
>
> That is, I would naturally expect that
> when_all(S).ready() iff =E2=88=80x=E2=88=88S : S.ready(),
> and
> when_any(S).ready() iff =E2=88=83x=E2=88=88S : S.ready().
>
> Instead it looks like we have
>
> when_all(S).ready() iff =E2=88=80x=E2=88=88S : S.ready(),
> and
> when_any(S).ready() iff S=3D=E2=88=85 =E2=88=A8 =E2=88=83x=E2=88=88S : =
S.ready().
>
> I'm still curious about the rationale behind this choice; but for the
> moment I'm happy to have found that it was a conscious decision (not an
> oversight), and also to have learned about N4399.
> The rationale probably comes down to something like "A future that's
> always-unready can't possibly be useful, so anytime we'd make one of thos=
e,
> let's make an always-ready future instead."
>
> =E2=80=93Arthur
>
> --
>
>
I was once a mathematician and philosopher, so I feel embarrassed to have
gone against the rules of logic.
I think someone should open a bug/issue and have when_any() follow the
rules of logic.
Thanks.
--=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/.
--001a11c3c8baa2bce2051f80aae4
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 Wed, Sep 9, 2015 at 1:27 AM, Arthur O'Dwyer <span dir=3D"ltr">&l=
t;<a href=3D"mailto:arthur.j.odwyer@gmail.com" target=3D"_blank">arthur.j.o=
dwyer@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"">On Tue, Sep 8, 2015 at 11:48 AM, Tony V E <s=
pan dir=3D"ltr"><<a href=3D"mailto:tvaneerd@gmail.com" target=3D"_blank"=
>tvaneerd@gmail.com</a>></span> wrote:<br></span><div class=3D"gmail_ext=
ra"><div class=3D"gmail_quote"><span class=3D""><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 dir=
=3D"ltr">On Tue, Sep 8, 2015 at 4:35 AM, Arthur O'Dwyer <span dir=3D"lt=
r"><<a href=3D"mailto:arthur.j.odwyer@gmail.com" target=3D"_blank">arthu=
r.j.odwyer@gmail.com</a>></span> wrote:<br><div class=3D"gmail_extra"><d=
iv class=3D"gmail_quote"><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 dir=3D"ltr"><span>I keep fin=
ding newer and newer versions of this paper! If there's one out there w=
hich is newer than <a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/p=
apers/2014/n3857.pdf" target=3D"_blank">N3857</a> (which supersedes N3784, =
which superseded N3721, which superseded N3634, which superseded N3558, whi=
ch superseded N3428), please let me know. :)<div><br></div><div>I have at l=
east three questions. #2 is the most important to me right now.</div><br></=
span><span><div><b>(2)</b> What should be the result of</div><div><br></div=
><div><font face=3D"courier new, monospace">=C2=A0 =C2=A0 std::future<st=
d::tuple<>> f =3D std::when_any(); =C2=A0// call the variadic-temp=
late version with zero arguments</font></div><div><font face=3D"courier new=
, monospace">=C2=A0 =C2=A0 assert(f.valid()); =C2=A0// yes?</font></div><di=
v><font face=3D"courier new, monospace">=C2=A0 =C2=A0 assert(not f.ready())=
; =C2=A0// yes... or no?</font></div><div><font face=3D"courier new, monosp=
ace">=C2=A0 =C2=A0 f.get(); =C2=A0// blocks forever... or throws std::broke=
n_promise? ...or something else?</font></div><div><br></div><br></span><spa=
n><div>The same question applies to <font face=3D"courier new, monospace">s=
td::when_n</font>, whenever <i>that</i> gets proposed: what should be the r=
esult of <font face=3D"courier new, monospace">std::when_n(10, f, g, h)</fo=
nt>? A future that becomes ready only when 10 of the 3 inputs have been sat=
isfied, or a future that becomes ready as soon as <i>all</i>=C2=A03 of the =
inputs have been satisfied?</div></span></div></blockquote></div><br></div>=
<div class=3D"gmail_extra">One possible bit of reasoning: what do you expec=
t of when_all() for zero args?=C2=A0 They are all (ie the none of them) rea=
dy, so I think it should be ready. (Or "there are none not ready"=
..)<br></div></div></blockquote><div><br></div></span><div>Correct. All 0 of=
the 0 provided arguments are ready; therefore when_all() returns a ready f=
uture.</div><span class=3D""><div>=C2=A0</div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-co=
lor:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir=3D"=
ltr"><div class=3D"gmail_extra"></div><div class=3D"gmail_extra">Now, do yo=
u expect when_any(X) to ever fail if when_all(X) succeeded?<br></div></div>=
</blockquote><div><br></div></span><div>Yes, naturally, in the case when X =
is the empty set.</div><div>None of the 0 provided arguments are ready; the=
refore when_any() strictly ought to return an unready future.</div><div><a =
href=3D"http://math.stackexchange.com/questions/657931/why-negating-univers=
al-quantifier-gives-existential-quantifier" target=3D"_blank">http://math.s=
tackexchange.com/questions/657931/why-negating-universal-quantifier-gives-e=
xistential-quantifier<br></a></div><br>That is, I would naturally expect th=
at<br>when_all(S).ready() =C2=A0iff =C2=A0=E2=88=80x=E2=88=88S : S.ready(),=
<br>and<br>when_any(S).ready() =C2=A0iff =C2=A0=E2=88=83x=E2=88=88S : S.rea=
dy().</div><div class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">=
Instead it looks like we have<br><div><br></div><div><div class=3D"gmail_qu=
ote">when_all(S).ready() =C2=A0iff =C2=A0=E2=88=80x=E2=88=88S : S.ready(),<=
br>and<br>when_any(S).ready() =C2=A0iff =C2=A0S=3D=E2=88=85 =E2=88=A8 =E2=
=88=83x=E2=88=88S : S.ready().</div></div><div><br></div><div>I'm still=
curious about the rationale behind this choice; but for the moment I'm=
happy to have found that it was a conscious decision (not an oversight), a=
nd also to have learned about N4399.</div><div>The rationale probably comes=
down to something like "A future that's always-unready can't =
possibly be useful, so anytime we'd make one of those, let's make a=
n always-ready future instead."</div><span class=3D"HOEnZb"><font colo=
r=3D"#888888"><div><br></div><div>=E2=80=93Arthur</div></font></span></div>=
</div></div><div class=3D"HOEnZb"><div class=3D"h5">
<p></p>
-- <br>
<br></div></div></blockquote><div><br></div></div>I was once a mathematicia=
n and philosopher, so I feel embarrassed to have gone against the rules of =
logic.<br></div><div class=3D"gmail_extra">I think someone should open a bu=
g/issue and have when_any() follow the rules of logic.<br><br></div><div cl=
ass=3D"gmail_extra">Thanks.<br><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 />
--001a11c3c8baa2bce2051f80aae4--
.