Topic: report typo : N3784 Improvements to


Author: laksberg@hotmail.com
Date: Thu, 16 Jan 2014 18:08:03 -0800 (PST)
Raw View
------=_Part_7423_17704683.1389924483438
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Akira,

Thanks! I'm including your corrections into the next revision of the=20
document.

Artur Laksberg

On Sunday, December 15, 2013 9:58:08 PM UTC-8, Akira Takahashi wrote:
>
> Hi,
> I found few minor typo.
>
> N3784 Improvements to std::future<T> and Related APIs
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3784.pdf
>
> 1. `then` example.
> `int` hasn't `to_string` member function.
>
> #include <future>
> using namespace std;
> int main() {
>     future<int> f1 =3D async([]() { return 123; });
>     future<string> f2 =3D f1.then([](future<int> f) {
>         return f.get().to_string(); // here .get() won=E2=80=99t block
>     });
> }
>
> should be:
>
>         return to_string(f.get()); // here .get() won=E2=80=99t block
>
>
> 2. `unwrap` example.
> `future` need template argument.
>
> #include <future>
> using namespace std;
> int main() {
>     future<future<int>> outer_future =3D async([]{
>         future<int> inner_future =3D async([] {
>             return 1;
>         });
>         return inner_future;
>     });
>
>     future<int> inner_future =3D outer_future.unwrap();
>
>     inner_future.then([](future f) { // need template argument
>         do_work(f);
>     });
> }
>
> should be:
>
>     inner_future.then([](future<int> f) {
>
>
> Thanks,
> Akira
>
> =3D=3D
> Akira Takahashi
> site: sites.google.com/site/faithandbrave/about/en
>

--=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_7423_17704683.1389924483438
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Akira,<div><br></div><div>Thanks! I'm including your corre=
ctions into the next revision of the document.</div><div><br></div><div>Art=
ur Laksberg<br><br>On Sunday, December 15, 2013 9:58:08 PM UTC-8, Akira Tak=
ahashi wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">=
Hi,<div>I found few minor typo.</div><div><br></div><div>N3784 Improvements=
 to std::future&lt;T&gt; and Related APIs<br></div><div><a href=3D"http://w=
ww.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3784.pdf" target=3D"_blank=
" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fww=
w.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fdocs%2Fpapers%2F2013%2Fn3784.pdf\46sa=
\75D\46sntz\0751\46usg\75AFQjCNGSwm5sj92utU5i4cbQFHZY3EWcXg';return true;" =
onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fwww.open=
-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fdocs%2Fpapers%2F2013%2Fn3784.pdf\46sa\75D\4=
6sntz\0751\46usg\75AFQjCNGSwm5sj92utU5i4cbQFHZY3EWcXg';return true;">http:/=
/www.open-std.org/jtc1/<wbr>sc22/wg21/docs/papers/2013/<wbr>n3784.pdf</a><b=
r></div><div><br></div><div>1. `then` example.</div><div>`int` hasn't `to_s=
tring` member function.</div><div><br></div><div><div>#include &lt;future&g=
t;</div><div>using namespace std;</div><div>int main() {</div><div>&nbsp; &=
nbsp; future&lt;int&gt; f1 =3D async([]() { return 123; });</div><div>&nbsp=
; &nbsp; future&lt;string&gt; f2 =3D f1.then([](future&lt;int&gt; f) {</div=
><div>&nbsp; &nbsp; &nbsp; &nbsp; return f.get().to_string(); // here .get(=
) won=E2=80=99t block</div><div>&nbsp; &nbsp; });</div><div>}</div></div><d=
iv><br></div><div>should be:</div><div><br></div><div>&nbsp; &nbsp; &nbsp; =
&nbsp; return to_string(f.get()); // here .get() won=E2=80=99t block<br></d=
iv><div><br></div><div><br></div><div>2. `unwrap` example.</div><div>`futur=
e` need template argument.</div><div><br></div><div><div>#include &lt;futur=
e&gt;</div><div>using namespace std;</div><div>int main() {</div><div>&nbsp=
; &nbsp; future&lt;future&lt;int&gt;&gt; outer_future =3D async([]{</div><d=
iv>&nbsp; &nbsp; &nbsp; &nbsp; future&lt;int&gt; inner_future =3D async([] =
{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 1;</div><div>&=
nbsp; &nbsp; &nbsp; &nbsp; });</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return=
 inner_future;</div><div>&nbsp; &nbsp; });</div><div><br></div><div>&nbsp; =
&nbsp; future&lt;int&gt; inner_future =3D outer_future.unwrap();</div><div>=
<br></div><div>&nbsp; &nbsp; inner_future.then([](future f) { // need templ=
ate argument</div><div>&nbsp; &nbsp; &nbsp; &nbsp; do_work(f);</div><div>&n=
bsp; &nbsp; });</div><div>}</div></div><div><br></div><div>should be:</div>=
<div><br></div><div><div>&nbsp; &nbsp; inner_future.then([](future&lt;<wbr>=
int&gt; f) {</div></div><div><br></div><div><br></div><div>Thanks,</div><di=
v>Akira</div><div><br></div><div>=3D=3D</div><div>Akira Takahashi</div><div=
>site:&nbsp;<a href=3D"http://sites.google.com/site/faithandbrave/about/en"=
 target=3D"_blank" onmousedown=3D"this.href=3D'http://www.google.com/url?q\=
75http%3A%2F%2Fsites.google.com%2Fsite%2Ffaithandbrave%2Fabout%2Fen\46sa\75=
D\46sntz\0751\46usg\75AFQjCNHPDiRr-077hs8MPh6dHzohmrCh9w';return true;" onc=
lick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fsites.googl=
e.com%2Fsite%2Ffaithandbrave%2Fabout%2Fen\46sa\75D\46sntz\0751\46usg\75AFQj=
CNHPDiRr-077hs8MPh6dHzohmrCh9w';return true;">sites.google.com/site/<wbr>fa=
ithandbrave/about/en</a></div></div></blockquote></div></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to 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/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_7423_17704683.1389924483438--

.