Topic: [Concurrency TS] Can shared_future::then be called
Author: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Date: Sat, 24 Jan 2015 10:30:28 +0100
Raw View
This is a multi-part message in MIME format.
--------------000804050309010009060200
Content-Type: text/plain; charset=UTF-8; format=flowed
Hi,
As shared_future is copyable, I'm wondering if shared_future::then could
be called several times as the continuation don't consume the future value.
shared_future<int> f;
auto x = f.then(fx);
auto y = f.then(fy);
IMO, the wording is not precise enough respect to this point.
I think the intent was to allow only one call at a time.
shared_future<int> f;
auto x = f.then(fx);
auto y = f.then(fy); // should throw an exception or undefined behavior
if fx has not been called already
What others think?
Vicente
--
---
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/.
--------------000804050309010009060200
Content-Type: text/html; charset=UTF-8
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font size="+1">Hi,<br>
<br>
As shared_future is copyable, I'm wondering if shared_future::then
could be called several times as the continuation don't consume
the future value.<br>
<br>
shared_future<int> f;<br>
auto x = f.then(fx);<br>
</font><font size="+1"><font size="+1">auto y = f.then(fy);<br>
</font><br>
IMO, the wording is not precise enough respect to this point. <br>
I think the intent was to allow only one call at a time.<br>
<br>
</font><font size="+1">shared_future<int> f;<br>
auto x = f.then(fx);<br>
</font><font size="+1"><font size="+1">auto y = f.then(fy); //
should throw an exception or undefined behavior if fx has not
been called already<br>
</font></font><br>
What others think?<br>
<br>
Vicente<br>
</body>
</html>
<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 />
--------------000804050309010009060200--
.