3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>use_awaitable_t::executor_with_default::default_completion_token_type</title>
5 <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../boost_asio.html" title="Boost.Asio">
8 <link rel="up" href="../use_awaitable_t__executor_with_default.html" title="use_awaitable_t::executor_with_default">
9 <link rel="prev" href="../use_awaitable_t__executor_with_default.html" title="use_awaitable_t::executor_with_default">
10 <link rel="next" href="executor_with_default.html" title="use_awaitable_t::executor_with_default::executor_with_default">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="../use_awaitable_t__executor_with_default.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../use_awaitable_t__executor_with_default.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="executor_with_default.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type"></a><a class="link" href="default_completion_token_type.html" title="use_awaitable_t::executor_with_default::default_completion_token_type">use_awaitable_t::executor_with_default::default_completion_token_type</a>
28 </h4></div></div></div>
30 <a class="indexterm" name="boost_asio.indexterm.use_awaitable_t__executor_with_default.default_completion_token_type"></a>
32 <code class="computeroutput">use_awaitable_t</code> as the default completion token type.
34 <pre class="programlisting">typedef use_awaitable_t default_completion_token_type;
37 <a name="boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type.h0"></a>
38 <span class="phrase"><a name="boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type.types"></a></span><a class="link" href="default_completion_token_type.html#boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type.types">Types</a>
40 <div class="informaltable"><table class="table">
60 <a class="link" href="../use_awaitable_t__executor_with_default.html" title="use_awaitable_t::executor_with_default"><span class="bold"><strong>executor_with_default</strong></span></a>
65 Adapts an executor to add the use_awaitable_t completion token
72 <a name="boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type.h1"></a>
73 <span class="phrase"><a name="boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type.member_functions"></a></span><a class="link" href="default_completion_token_type.html#boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type.member_functions">Member
76 <div class="informaltable"><table class="table">
97 <a class="link" href="../use_awaitable_t/as_default_on.html" title="use_awaitable_t::as_default_on"><span class="bold"><strong>as_default_on</strong></span></a>
102 Function helper to adapt an I/O object to use use_awaitable_t
103 as its default completion token type.
110 <a class="link" href="../use_awaitable_t/use_awaitable_t.html" title="use_awaitable_t::use_awaitable_t"><span class="bold"><strong>use_awaitable_t</strong></span></a>
122 The <code class="computeroutput">use_awaitable_t</code> class, with its value <code class="computeroutput">use_awaitable</code>,
123 is used to represent the currently executing coroutine. This completion
124 token may be passed as a handler to an asynchronous operation. For example:
126 <pre class="programlisting">awaitable<void> my_coroutine()
128 std::size_t n = co_await my_socket.async_read_some(buffer, use_awaitable);
133 When used with co_await, the initiating function (<code class="computeroutput">async_read_some</code>
134 in the above example) suspends the current coroutine. The coroutine is
135 resumed when the asynchronous operation completes, and the result of the
136 operation is returned.
139 <a name="boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type.h2"></a>
140 <span class="phrase"><a name="boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type.requirements"></a></span><a class="link" href="default_completion_token_type.html#boost_asio.reference.use_awaitable_t__executor_with_default.default_completion_token_type.requirements">Requirements</a>
143 <span class="emphasis"><em>Header: </em></span><code class="literal">boost/asio/use_awaitable.hpp</code>
146 <span class="emphasis"><em>Convenience header: </em></span><code class="literal">boost/asio.hpp</code>
149 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
150 <td align="left"></td>
151 <td align="right"><div class="copyright-footer">Copyright © 2003-2019 Christopher M. Kohlhoff<p>
152 Distributed under the Boost Software License, Version 1.0. (See accompanying
153 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
158 <div class="spirit-nav">
159 <a accesskey="p" href="../use_awaitable_t__executor_with_default.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../use_awaitable_t__executor_with_default.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="executor_with_default.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>