src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp in passenger-6.0.16 vs src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp in passenger-6.0.17

- old
+ new

@@ -17,12 +17,14 @@ #include <boost/asio/detail/config.hpp> #include <boost/asio/async_result.hpp> #include <boost/asio/detail/type_traits.hpp> #include <boost/asio/execution_context.hpp> +#include <boost/asio/execution/blocking.hpp> #include <boost/asio/execution/executor.hpp> #include <boost/asio/is_executor.hpp> +#include <boost/asio/require.hpp> #include <boost/asio/detail/push_options.hpp> namespace boost { namespace asio { @@ -66,16 +68,15 @@ * * @li Obtains the handler's associated allocator object @c alloc by performing * @code auto alloc = get_associated_allocator(handler); @endcode * * @li If <tt>execution::is_executor<Ex>::value</tt> is true, performs - * @code execution::execute( - * prefer( - * require(ex, execution::blocking.never), - * execution::relationship.continuation, - * execution::allocator(alloc)), - * std::forward<CompletionHandler>(completion_handler)); @endcode + * @code prefer( + * require(ex, execution::blocking.never), + * execution::relationship.continuation, + * execution::allocator(alloc) + * ).execute(std::forward<CompletionHandler>(completion_handler)); @endcode * * @li If <tt>execution::is_executor<Ex>::value</tt> is false, performs * @code ex.defer( * std::forward<CompletionHandler>(completion_handler), * alloc); @endcode @@ -135,31 +136,27 @@ * function object @c f with a member @c executor_ that is initialised with * <tt>prefer(ex1, execution::outstanding_work.tracked)</tt>, a member @c * handler_ that is a decay-copy of @c completion_handler, and a function call * operator that performs: * @code auto a = get_associated_allocator(handler_); - * execution::execute( - * prefer(executor_, - * execution::blocking.possibly, - * execution::allocator(a)), - * std::move(handler_)); @endcode + * prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); + * @endcode * * @li If <tt>execution::is_executor<Ex1>::value</tt> is false, constructs a * function object @c f with a member @c work_ that is initialised with * <tt>make_work_guard(ex1)</tt>, a member @c handler_ that is a decay-copy of * @c completion_handler, and a function call operator that performs: * @code auto a = get_associated_allocator(handler_); * work_.get_executor().dispatch(std::move(handler_), a); * work_.reset(); @endcode * * @li If <tt>execution::is_executor<Ex>::value</tt> is true, performs - * @code execution::execute( - * prefer( - * require(ex, execution::blocking.never), - * execution::relationship.continuation, - * execution::allocator(alloc)), - * std::move(f)); @endcode + * @code prefer( + * require(ex, execution::blocking.never), + * execution::relationship.continuation, + * execution::allocator(alloc) + * ).execute(std::move(f)); @endcode * * @li If <tt>execution::is_executor<Ex>::value</tt> is false, performs * @code ex.defer(std::move(f), alloc); @endcode * * @par Completion Signature @@ -171,10 +168,12 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(NullaryToken, void()) defer( const Executor& ex, BOOST_ASIO_MOVE_ARG(NullaryToken) token BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(Executor), typename constraint< - execution::is_executor<Executor>::value || is_executor<Executor>::value + (execution::is_executor<Executor>::value + && can_require<Executor, execution::blocking_t::never_t>::value) + || is_executor<Executor>::value >::type = 0) BOOST_ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX(( async_initiate<NullaryToken, void()>( declval<detail::initiate_defer_with_executor<Executor> >(), token)));