diff options
Diffstat (limited to '3rdparty/asio/include/asio/spawn.hpp')
-rw-r--r-- | 3rdparty/asio/include/asio/spawn.hpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/3rdparty/asio/include/asio/spawn.hpp b/3rdparty/asio/include/asio/spawn.hpp index cffe4312e5d..780de6b7284 100644 --- a/3rdparty/asio/include/asio/spawn.hpp +++ b/3rdparty/asio/include/asio/spawn.hpp @@ -2,7 +2,7 @@ // spawn.hpp // ~~~~~~~~~ // -// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -17,11 +17,11 @@ #include "asio/detail/config.hpp" #include <boost/coroutine/all.hpp> +#include "asio/any_io_executor.hpp" #include "asio/bind_executor.hpp" #include "asio/detail/memory.hpp" #include "asio/detail/type_traits.hpp" #include "asio/detail/wrapped_handler.hpp" -#include "asio/executor.hpp" #include "asio/io_context.hpp" #include "asio/is_executor.hpp" #include "asio/strand.hpp" @@ -151,7 +151,7 @@ private: typedef basic_yield_context<unspecified> yield_context; #else // defined(GENERATING_DOCUMENTATION) typedef basic_yield_context< - executor_binder<void(*)(), executor> > yield_context; + executor_binder<void(*)(), any_io_executor> > yield_context; #endif // defined(GENERATING_DOCUMENTATION) /** @@ -225,8 +225,10 @@ void spawn(ASIO_MOVE_ARG(Handler) handler, ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes(), - typename enable_if<!is_executor<typename decay<Handler>::type>::value && - !is_convertible<Handler&, execution_context&>::value>::type* = 0); + typename constraint< + !is_executor<typename decay<Handler>::type>::value && + !execution::is_executor<typename decay<Handler>::type>::value && + !is_convertible<Handler&, execution_context&>::value>::type = 0); /// Start a new stackful coroutine, inheriting the execution context of another. /** @@ -266,7 +268,9 @@ void spawn(const Executor& ex, ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes(), - typename enable_if<is_executor<Executor>::value>::type* = 0); + typename constraint< + is_executor<Executor>::value || execution::is_executor<Executor>::value + >::type = 0); /// Start a new stackful coroutine that executes on a given strand. /** @@ -285,6 +289,8 @@ void spawn(const strand<Executor>& ex, const boost::coroutines::attributes& attributes = boost::coroutines::attributes()); +#if !defined(ASIO_NO_TS_EXECUTORS) + /// Start a new stackful coroutine that executes in the context of a strand. /** * This function is used to launch a new coroutine. @@ -304,6 +310,8 @@ void spawn(const asio::io_context::strand& s, const boost::coroutines::attributes& attributes = boost::coroutines::attributes()); +#endif // !defined(ASIO_NO_TS_EXECUTORS) + /// Start a new stackful coroutine that executes on a given execution context. /** * This function is used to launch a new coroutine. @@ -322,8 +330,8 @@ void spawn(ExecutionContext& ctx, ASIO_MOVE_ARG(Function) function, const boost::coroutines::attributes& attributes = boost::coroutines::attributes(), - typename enable_if<is_convertible< - ExecutionContext&, execution_context&>::value>::type* = 0); + typename constraint<is_convertible< + ExecutionContext&, execution_context&>::value>::type = 0); /*@}*/ |