*
* where @c E is convertible from @c Executor.
*/
-template <typename Executor, typename F, typename CompletionToken>
-BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken,
+template <typename Executor, typename F,
+ BOOST_ASIO_COMPLETION_TOKEN_FOR(typename detail::awaitable_signature<
+ typename result_of<F()>::type>::type) CompletionToken
+ BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor)>
+BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
typename detail::awaitable_signature<typename result_of<F()>::type>::type)
-co_spawn(const Executor& ex, F&& f, CompletionToken&& token,
+co_spawn(const Executor& ex, F&& f,
+ CompletionToken&& token
+ BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(Executor),
typename enable_if<
is_executor<Executor>::value
>::type* = 0);
*
* where @c E is convertible from @c ExecutionContext::executor_type.
*/
-template <typename ExecutionContext, typename F, typename CompletionToken>
-BOOST_ASIO_INITFN_RESULT_TYPE(CompletionToken,
+template <typename ExecutionContext, typename F,
+ BOOST_ASIO_COMPLETION_TOKEN_FOR(typename detail::awaitable_signature<
+ typename result_of<F()>::type>::type) CompletionToken
+ BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(
+ typename ExecutionContext::executor_type)>
+BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken,
typename detail::awaitable_signature<typename result_of<F()>::type>::type)
-co_spawn(ExecutionContext& ctx, F&& f, CompletionToken&& token,
+co_spawn(ExecutionContext& ctx, F&& f,
+ CompletionToken&& token
+ BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(
+ typename ExecutionContext::executor_type),
typename enable_if<
is_convertible<ExecutionContext&, execution_context&>::value
>::type* = 0);