diff --git a/doc/reference.qbk b/doc/reference.qbk index 35b6906f..fa24ffec 100644 --- a/doc/reference.qbk +++ b/doc/reference.qbk @@ -5423,7 +5423,7 @@ Traits type used to obtain the executor associated with an object. template< typename T, - typename ``[link boost_asio.reference.Executor1 Executor]`` = system_executor> + typename ``[link boost_asio.reference.Executor1 Executor]`` = inline_executor> struct associated_executor @@ -23088,6 +23088,337 @@ The [link boost_asio.reference.basic_file `basic_file`] class template provides +[endsect] + +[section:basic_inline_executor basic_inline_executor] + +[indexterm1 boost_asio.indexterm.basic_inline_executor..basic_inline_executor] + + +An executor that always executes the function object inline. + + + template< + typename InlineExceptionHandling> + class basic_inline_executor + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_inline_executor.basic_inline_executor [*basic_inline_executor]] [constructor]] + [Default constructor. ] + ] + + [ + [[link boost_asio.reference.basic_inline_executor.execute [*execute]]] + [Execution function. ] + ] + + [ + [[link boost_asio.reference.basic_inline_executor.query__static [*query]] [static]] + [Query the current value of the mapping property. + [hr] + Query the current value of the inline_exception_handling property. + [hr] + Query the current value of the blocking property. ] + ] + + [ + [[link boost_asio.reference.basic_inline_executor.require [*require]]] + [Obtain an executor with the inline_exception_handling.propagate property. + [hr] + Obtain an executor with the inline_exception_handling.terminate property. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_inline_executor.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link boost_asio.reference.basic_inline_executor.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/inline_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:basic_inline_executor basic_inline_executor::basic_inline_executor] + +[indexterm2 boost_asio.indexterm.basic_inline_executor.basic_inline_executor..basic_inline_executor..basic_inline_executor] +Default constructor. + + + basic_inline_executor(); + + + +[endsect] + + + +[section:execute basic_inline_executor::execute] + +[indexterm2 boost_asio.indexterm.basic_inline_executor.execute..execute..basic_inline_executor] +Execution function. + + + template< + typename Function> + void execute( + Function && f) const; + + + +[endsect] + + + +[section:operator_not__eq_ basic_inline_executor::operator!=] + +[indexterm2 boost_asio.indexterm.basic_inline_executor.operator_not__eq_..operator!=..basic_inline_executor] +Compare two executors for inequality. + + + bool operator!=( + const basic_inline_executor & , + const basic_inline_executor & ); + + +Two inline executors are never considered unequal. + +[heading Requirements] + +['Header: ][^boost/asio/inline_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:operator_eq__eq_ basic_inline_executor::operator==] + +[indexterm2 boost_asio.indexterm.basic_inline_executor.operator_eq__eq_..operator==..basic_inline_executor] +Compare two executors for equality. + + + bool operator==( + const basic_inline_executor & , + const basic_inline_executor & ); + + +Two inline executors are always considered equal. + +[heading Requirements] + +['Header: ][^boost/asio/inline_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[section:query__static basic_inline_executor::query] + +[indexterm2 boost_asio.indexterm.basic_inline_executor.query__static..query..basic_inline_executor] +Query the current value of the `mapping` property. + + + static constexpr execution::mapping_t ``[link boost_asio.reference.basic_inline_executor.query__static.overload1 query]``( + execution::mapping_t ); + `` [''''»''' [link boost_asio.reference.basic_inline_executor.query__static.overload1 more...]]`` + + +Query the current value of the `inline_exception_handling` property. + + + static constexpr execution::inline_exception_handling_t ``[link boost_asio.reference.basic_inline_executor.query__static.overload2 query]``( + execution::inline_exception_handling_t ); + `` [''''»''' [link boost_asio.reference.basic_inline_executor.query__static.overload2 more...]]`` + + +Query the current value of the `blocking` property. + + + static constexpr execution::blocking_t ``[link boost_asio.reference.basic_inline_executor.query__static.overload3 query]``( + execution::blocking_t ); + `` [''''»''' [link boost_asio.reference.basic_inline_executor.query__static.overload3 more...]]`` + + +[section:overload1 basic_inline_executor::query (1 of 3 overloads)] + + +Query the current value of the `mapping` property. + + + static constexpr execution::mapping_t query( + execution::mapping_t ); + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.query `query`] customisation point. + +For example: + + boost::asio::inline_executor ex; + if (boost::asio::query(ex, boost::asio::execution::mapping) + == boost::asio::execution::mapping.thread) + ... + + + + + +[endsect] + + + +[section:overload2 basic_inline_executor::query (2 of 3 overloads)] + + +Query the current value of the `inline_exception_handling` property. + + + static constexpr execution::inline_exception_handling_t query( + execution::inline_exception_handling_t ); + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.query `query`] customisation point. + +For example: + + boost::asio::inline_executor ex; + if (boost::asio::query(ex, + boost::asio::execution::inline_exception_handling) + == boost::asio::execution::inline_exception_handling.propagate) + ... + + + + + +[endsect] + + + +[section:overload3 basic_inline_executor::query (3 of 3 overloads)] + + +Query the current value of the `blocking` property. + + + static constexpr execution::blocking_t query( + execution::blocking_t ); + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.query `query`] customisation point. + +For example: + + boost::asio::inline_executor ex; + if (boost::asio::query(ex, boost::asio::execution::blocking) + == boost::asio::execution::blocking.always) + ... + + + + + +[endsect] + + +[endsect] + +[section:require basic_inline_executor::require] + +[indexterm2 boost_asio.indexterm.basic_inline_executor.require..require..basic_inline_executor] +Obtain an executor with the `inline_exception_handling.propagate` property. + + + basic_inline_executor< execution::inline_exception_handling_t::propagate_t > ``[link boost_asio.reference.basic_inline_executor.require.overload1 require]``( + execution::inline_exception_handling_t::propagate_t ) const; + `` [''''»''' [link boost_asio.reference.basic_inline_executor.require.overload1 more...]]`` + + +Obtain an executor with the `inline_exception_handling.terminate` property. + + + basic_inline_executor< execution::inline_exception_handling_t::terminate_t > ``[link boost_asio.reference.basic_inline_executor.require.overload2 require]``( + execution::inline_exception_handling_t::terminate_t ) const; + `` [''''»''' [link boost_asio.reference.basic_inline_executor.require.overload2 more...]]`` + + +[section:overload1 basic_inline_executor::require (1 of 2 overloads)] + + +Obtain an executor with the `inline_exception_handling.propagate` property. + + + basic_inline_executor< execution::inline_exception_handling_t::propagate_t > require( + execution::inline_exception_handling_t::propagate_t ) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.require `require`] customisation point. + +For example: + + boost::asio::inline_executor ex1; + auto ex2 = boost::asio::require(ex1, + boost::asio::execution::inline_exception_handling.propagate); + + + + + +[endsect] + + + +[section:overload2 basic_inline_executor::require (2 of 2 overloads)] + + +Obtain an executor with the `inline_exception_handling.terminate` property. + + + basic_inline_executor< execution::inline_exception_handling_t::terminate_t > require( + execution::inline_exception_handling_t::terminate_t ) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.require `require`] customisation point. + +For example: + + boost::asio::inline_executor ex1; + auto ex2 = boost::asio::require(ex1, + boost::asio::execution::inline_exception_handling.terminate); + + + + + +[endsect] + + +[endsect] + + [endsect] [section:basic_io_object basic_io_object] @@ -67793,6 +68124,8 @@ An executor that uses arbitrary threads. [ [[link boost_asio.reference.basic_system_executor.query__static [*query]] [static]] [Query the current value of the mapping property. + [hr] + Query the current value of the inline_exception_handling property. [hr] Query the current value of the context property. [hr] @@ -68203,31 +68536,39 @@ Query the current value of the `mapping` property. `` [''''»''' [link boost_asio.reference.basic_system_executor.query__static.overload1 more...]]`` +Query the current value of the `inline_exception_handling` property. + + + static constexpr execution::inline_exception_handling_t ``[link boost_asio.reference.basic_system_executor.query__static.overload2 query]``( + execution::inline_exception_handling_t ); + `` [''''»''' [link boost_asio.reference.basic_system_executor.query__static.overload2 more...]]`` + + Query the current value of the `context` property. - static system_context & ``[link boost_asio.reference.basic_system_executor.query__static.overload2 query]``( + static system_context & ``[link boost_asio.reference.basic_system_executor.query__static.overload3 query]``( execution::context_t ); - `` [''''»''' [link boost_asio.reference.basic_system_executor.query__static.overload2 more...]]`` + `` [''''»''' [link boost_asio.reference.basic_system_executor.query__static.overload3 more...]]`` Query the current value of the `blocking` property. - static constexpr execution::blocking_t ``[link boost_asio.reference.basic_system_executor.query__static.overload3 query]``( + static constexpr execution::blocking_t ``[link boost_asio.reference.basic_system_executor.query__static.overload4 query]``( execution::blocking_t ); - `` [''''»''' [link boost_asio.reference.basic_system_executor.query__static.overload3 more...]]`` + `` [''''»''' [link boost_asio.reference.basic_system_executor.query__static.overload4 more...]]`` Query the current value of the `relationship` property. - static constexpr execution::relationship_t ``[link boost_asio.reference.basic_system_executor.query__static.overload4 query]``( + static constexpr execution::relationship_t ``[link boost_asio.reference.basic_system_executor.query__static.overload5 query]``( execution::relationship_t ); - `` [''''»''' [link boost_asio.reference.basic_system_executor.query__static.overload4 more...]]`` + `` [''''»''' [link boost_asio.reference.basic_system_executor.query__static.overload5 more...]]`` -[section:overload1 basic_system_executor::query (1 of 4 overloads)] +[section:overload1 basic_system_executor::query (1 of 5 overloads)] Query the current value of the `mapping` property. @@ -68254,7 +68595,35 @@ For example: -[section:overload2 basic_system_executor::query (2 of 4 overloads)] +[section:overload2 basic_system_executor::query (2 of 5 overloads)] + + +Query the current value of the `inline_exception_handling` property. + + + static constexpr execution::inline_exception_handling_t query( + execution::inline_exception_handling_t ); + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.query `query`] customisation point. + +For example: + + boost::asio::system_executor ex; + if (boost::asio::query(ex, + boost::asio::execution::inline_exception_handling) + == boost::asio::execution::inline_exception_handling.thread) + ... + + + + + +[endsect] + + + +[section:overload3 basic_system_executor::query (3 of 5 overloads)] Query the current value of the `context` property. @@ -68280,7 +68649,7 @@ For example: -[section:overload3 basic_system_executor::query (3 of 4 overloads)] +[section:overload4 basic_system_executor::query (4 of 5 overloads)] Query the current value of the `blocking` property. @@ -68307,7 +68676,7 @@ For example: -[section:overload4 basic_system_executor::query (4 of 4 overloads)] +[section:overload5 basic_system_executor::query (5 of 5 overloads)] Query the current value of the `relationship` property. @@ -84865,9 +85234,9 @@ If not otherwise specialised, the default completion token type is [link boost_a Submits a completion token or function object for execution. template< - typename ``[link boost_asio.reference.NullaryToken NullaryToken]``> + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = deferred_t> auto ``[link boost_asio.reference.defer.overload1 defer]``( - NullaryToken && token); + NullaryToken && token = deferred_t()); `` [''''»''' [link boost_asio.reference.defer.overload1 more...]]`` template< @@ -84888,6 +85257,62 @@ Submits a completion token or function object for execution. constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link boost_asio.reference.defer.overload3 more...]]`` +Submits a function to be run on a specified target executor, and after completion submits the completion handler. + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link boost_asio.reference.defer.overload4 defer]``( + Function && function, + const Executor & ex, + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + `` [''''»''' [link boost_asio.reference.defer.overload4 more...]]`` + +Submits a function to be run on a specified target executor, and passes the result to a completion handler. + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename CompletionToken = default_completion_token_t> + auto ``[link boost_asio.reference.defer.overload5 defer]``( + Function && function, + const Executor & ex, + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + `` [''''»''' [link boost_asio.reference.defer.overload5 more...]]`` + +Submits a function to be run on a specified execution context, and after completion submits the completion handler. + + template< + typename Function, + typename ExecutionContext, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link boost_asio.reference.defer.overload6 defer]``( + Function && function, + ExecutionContext & ctx, + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + `` [''''»''' [link boost_asio.reference.defer.overload6 more...]]`` + +Submits a function to be run on a specified execution context, and passes the result to a completion handler. + + template< + typename Function, + typename ExecutionContext, + typename CompletionToken = default_completion_token_t> + auto ``[link boost_asio.reference.defer.overload7 defer]``( + Function && function, + ExecutionContext & ctx, + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + `` [''''»''' [link boost_asio.reference.defer.overload7 more...]]`` + [heading Requirements] ['Header: ][^boost/asio/defer.hpp] @@ -84895,16 +85320,16 @@ Submits a completion token or function object for execution. ['Convenience header: ][^boost/asio.hpp] -[section:overload1 defer (1 of 3 overloads)] +[section:overload1 defer (1 of 7 overloads)] Submits a completion token or function object for execution. template< - typename ``[link boost_asio.reference.NullaryToken NullaryToken]``> + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = deferred_t> auto defer( - NullaryToken && token); + NullaryToken && token = deferred_t()); This function submits an object for execution using the object's associated executor. The function object is queued for execution, and is never called from the current thread prior to returning from `defer()`. @@ -84947,7 +85372,7 @@ The function call operator of `Init:` * Obtains the handler's associated executor object `ex` of type `Ex` by performing - auto ex = get_associated_executor(handler); + auto ex = get_associated_executor(completion_handler); @@ -84955,7 +85380,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(completion_handler); @@ -84999,7 +85424,7 @@ The function call operator of `Init:` -[section:overload2 defer (2 of 3 overloads)] +[section:overload2 defer (2 of 7 overloads)] Submits a completion token or function object for execution. @@ -85061,7 +85486,7 @@ The function call operator of `Init:` * Obtains the handler's associated executor object `ex1` of type `Ex1` by performing - auto ex1 = get_associated_executor(handler, ex); + auto ex1 = get_associated_executor(completion_handler, ex); @@ -85069,7 +85494,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(completion_handler); @@ -85094,7 +85519,7 @@ The function call operator of `Init:` -* If `execution::is_executor::value` is true, performs +* If `execution::is_executor::value` is true, performs prefer( require(ex, execution::blocking.never), @@ -85106,7 +85531,7 @@ The function call operator of `Init:` -* If `execution::is_executor::value` is false, performs +* If `execution::is_executor::value` is false, performs ex.defer(std::move(f), alloc); @@ -85130,7 +85555,7 @@ The function call operator of `Init:` -[section:overload3 defer (3 of 3 overloads)] +[section:overload3 defer (3 of 7 overloads)] Submits a completion token or function object for execution. @@ -85179,6 +85604,422 @@ Submits a completion token or function object for execution. +[endsect] + + + +[section:overload4 defer (4 of 7 overloads)] + + +Submits a function to be run on a specified target executor, and after completion submits the completion handler. + + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto defer( + Function && function, + const Executor & ex, + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + + +This function submits a function object for execution on the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `defer()`. After the submitted function completes, the completion handler is dispatched to run on its associated executor. + +The use of `defer()`, rather than [link boost_asio.reference.post `post`], indicates the caller's preference that the executor defer the queueing of the function object. This may allow the executor to optimise queueing for cases when the function object represents a continuation of the current call context. + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ex][The target executor.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(); +`` +]] + +] + + +[heading Return Value] + +This function returns `async_initiate(Init{ex}, token, forward(function))`, where `Init` is a function object type defined as: + + + + class Init + { + public: + using executor_type = Executor; + explicit Init(const Executor& ex) : ex_(ex) {} + executor_type get_executor() const noexcept { return ex_; } + template + void operator()(CompletionHandler&& completion_handler, + Function&& function) const; + private: + Executor ex_; // exposition only + }; + + + + +The function call operator of `Init:` + + +* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing + + auto ex1 = get_associated_executor(completion_handler, ex); + + + + + +* Obtains the handler's associated allocator object `alloc` by performing + + auto alloc = get_associated_allocator(completion_handler); + + + + + +* If `execution::is_executor::value` is true, constructs a function object wrapper `f` with a member `executor_` that is initialised with `prefer(ex1, execution::outstanding_work.tracked)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + std::move(function_)(); + auto a = get_associated_allocator(handler_); + prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); + + + + + +* If `execution::is_executor::value` is false, constructs a function object wrapper `f` with a member `work_` that is initialised with `make_work_guard(ex1)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + std::move(function_)(); + auto a = get_associated_allocator(handler_); + work_.get_executor().dispatch(std::move(handler_), a); + work_.reset(); + + + + + +* If `execution::is_executor::value` is true, performs + + prefer( + require(ex, execution::blocking.never), + execution::relationship.fork, + execution::allocator(alloc) + ).execute(std::move(f)); + + + + + +* If `execution::is_executor::value` is false, performs + + ex.defer(std::move(f), alloc); + + + + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void() + + + + + + + +[endsect] + + + +[section:overload5 defer (5 of 7 overloads)] + + +Submits a function to be run on a specified target executor, and passes the result to a completion handler. + + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename CompletionToken = default_completion_token_t> + auto defer( + Function && function, + const Executor & ex, + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + + +This function submits a function object for execution on the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `defer()`. After the submitted function completes, the completion handler is dispatched along with the function's result, to run on its associated executor. + +The use of `defer()`, rather than [link boost_asio.reference.post `post`], indicates the caller's preference that the executor defer the queueing of the function object. This may allow the executor to optimise queueing for cases when the function object represents a continuation of the current call context. + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ex][The target executor.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(decay_t()>>); +`` +]] + +] + + +[heading Return Value] + +This function returns `async_initiate(Init{ex}, token)`, where `Init` is a function object type defined as: + + + + class Init + { + public: + using executor_type = Executor; + explicit Init(const Executor& ex) : ex_(ex) {} + executor_type get_executor() const noexcept { return ex_; } + template + void operator()(CompletionHandler&& completion_handler, + Function&& function) const; + private: + Executor ex_; // exposition only + }; + + + + +The function call operator of `Init:` + + +* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing + + auto ex1 = get_associated_executor(completion_handler, ex); + + + + + +* Obtains the handler's associated allocator object `alloc` by performing + + auto alloc = get_associated_allocator(completion_handler); + + + + + +* If `execution::is_executor::value` is true, constructs a function object wrapper `f` with a member `executor_` that is initialised with `prefer(ex1, execution::outstanding_work.tracked)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + auto result = std::move(function_)(); + auto a = get_associated_allocator(handler_); + prefer(executor_, execution::allocator(a)).execute( + std::bind(std::move(handler_), std::move(result))); + + + + + +* If `execution::is_executor::value` is false, constructs a function object wrapper `f` with a member `work_` that is initialised with `make_work_guard(ex1)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + auto result = std::move(function_)(); + auto a = get_associated_allocator(handler_); + work_.get_executor().dispatch( + std::bind(std::move(handler_), std::move(result)), a); + work_.reset(); + + + + + +* If `execution::is_executor::value` is true, performs + + prefer( + require(ex, execution::blocking.never), + execution::relationship.fork, + execution::allocator(alloc) + ).execute(std::move(f)); + + + + + +* If `execution::is_executor::value` is false, performs + + ex.defer(std::move(f), alloc); + + + + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void(decay_t()>>) + + + + + + + +[endsect] + + + +[section:overload6 defer (6 of 7 overloads)] + + +Submits a function to be run on a specified execution context, and after completion submits the completion handler. + + + template< + typename Function, + typename ExecutionContext, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto defer( + Function && function, + ExecutionContext & ctx, + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ctx][An execution context, from which the target executor is obtained.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(); +`` +]] + +] + + +[heading Return Value] + +`defer(forward(function), ctx.get_executor(), forward(token))`. + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void() + + + + + + + +[endsect] + + + +[section:overload7 defer (7 of 7 overloads)] + + +Submits a function to be run on a specified execution context, and passes the result to a completion handler. + + + template< + typename Function, + typename ExecutionContext, + typename CompletionToken = default_completion_token_t> + auto defer( + Function && function, + ExecutionContext & ctx, + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ctx][An execution context, from which the target executor is obtained.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(); +`` +]] + +] + + +[heading Return Value] + +`defer(forward(function), ctx.get_executor(), forward(token))`. + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void(decay_t()>>) + + + + + + + [endsect] @@ -86915,9 +87756,9 @@ A cancellation filter that disables cancellation. Submits a completion token or function object for execution. template< - typename ``[link boost_asio.reference.NullaryToken NullaryToken]``> + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = deferred_t> auto ``[link boost_asio.reference.dispatch.overload1 dispatch]``( - NullaryToken && token); + NullaryToken && token = deferred_t()); `` [''''»''' [link boost_asio.reference.dispatch.overload1 more...]]`` template< @@ -86938,6 +87779,62 @@ Submits a completion token or function object for execution. constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link boost_asio.reference.dispatch.overload3 more...]]`` +Submits a function to be run on a specified target executor, and after completion submits the completion handler. + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link boost_asio.reference.dispatch.overload4 dispatch]``( + Function && function, + const Executor & ex, + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + `` [''''»''' [link boost_asio.reference.dispatch.overload4 more...]]`` + +Submits a function to be run on a specified target executor, and passes the result to a completion handler. + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename CompletionToken = default_completion_token_t> + auto ``[link boost_asio.reference.dispatch.overload5 dispatch]``( + Function && function, + const Executor & ex, + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + `` [''''»''' [link boost_asio.reference.dispatch.overload5 more...]]`` + +Submits a function to be run on a specified execution context, and after completion submits the completion handler. + + template< + typename Function, + typename ExecutionContext, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link boost_asio.reference.dispatch.overload6 dispatch]``( + Function && function, + ExecutionContext & ctx, + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + `` [''''»''' [link boost_asio.reference.dispatch.overload6 more...]]`` + +Submits a function to be run on a specified execution context, and passes the result to a completion handler. + + template< + typename Function, + typename ExecutionContext, + typename CompletionToken = default_completion_token_t> + auto ``[link boost_asio.reference.dispatch.overload7 dispatch]``( + Function && function, + ExecutionContext & ctx, + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + `` [''''»''' [link boost_asio.reference.dispatch.overload7 more...]]`` + [heading Requirements] ['Header: ][^boost/asio/dispatch.hpp] @@ -86945,16 +87842,16 @@ Submits a completion token or function object for execution. ['Convenience header: ][^boost/asio.hpp] -[section:overload1 dispatch (1 of 3 overloads)] +[section:overload1 dispatch (1 of 7 overloads)] Submits a completion token or function object for execution. template< - typename ``[link boost_asio.reference.NullaryToken NullaryToken]``> + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = deferred_t> auto dispatch( - NullaryToken && token); + NullaryToken && token = deferred_t()); This function submits an object for execution using the object's associated executor. The function object may be called from the current thread prior to returning from `dispatch()`. Otherwise, it is queued for execution. @@ -86995,7 +87892,7 @@ The function call operator of `Init:` * Obtains the handler's associated executor object `ex` of type `Ex` by performing - auto ex = get_associated_executor(handler); + auto ex = get_associated_executor(completion_handler); @@ -87003,7 +87900,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(completion_handler); @@ -87044,7 +87941,7 @@ The function call operator of `Init:` -[section:overload2 dispatch (2 of 3 overloads)] +[section:overload2 dispatch (2 of 7 overloads)] Submits a completion token or function object for execution. @@ -87104,7 +88001,7 @@ The function call operator of `Init:` * Obtains the handler's associated executor object `ex1` of type `Ex1` by performing - auto ex1 = get_associated_executor(handler, ex); + auto ex1 = get_associated_executor(completion_handler, ex); @@ -87112,7 +88009,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(completion_handler); @@ -87137,7 +88034,7 @@ The function call operator of `Init:` -* If `execution::is_executor::value` is true, performs +* If `execution::is_executor::value` is true, performs prefer(ex, execution::allocator(alloc)).execute(std::move(f)); @@ -87145,7 +88042,7 @@ The function call operator of `Init:` -* If `execution::is_executor::value` is false, performs +* If `execution::is_executor::value` is false, performs ex.dispatch(std::move(f), alloc); @@ -87169,7 +88066,7 @@ The function call operator of `Init:` -[section:overload3 dispatch (3 of 3 overloads)] +[section:overload3 dispatch (3 of 7 overloads)] Submits a completion token or function object for execution. @@ -87218,6 +88115,418 @@ Submits a completion token or function object for execution. +[endsect] + + + +[section:overload4 dispatch (4 of 7 overloads)] + + +Submits a function to be run on a specified target executor, and after completion submits the completion handler. + + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto dispatch( + Function && function, + const Executor & ex, + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + + +This function submits a function object for execution using the specified executor. The function object may be called from the current thread prior to returning from `dispatch()`. Otherwise, it is queued for execution. After the submitted function completes, the completion handler is dispatched to run on its associated executor. + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ex][The target executor.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(); +`` +]] + +] + + +[heading Return Value] + +This function returns `async_initiate(Init{ex}, token, forward(function))`, where `Init` is a function object type defined as: + + + + class Init + { + public: + using executor_type = Executor; + explicit Init(const Executor& ex) : ex_(ex) {} + executor_type get_executor() const noexcept { return ex_; } + template + void operator()(CompletionHandler&& completion_handler, + Function&& function) const; + private: + Executor ex_; // exposition only + }; + + + + +The function call operator of `Init:` + + +* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing + + auto ex1 = get_associated_executor(completion_handler, ex); + + + + + +* Obtains the handler's associated allocator object `alloc` by performing + + auto alloc = get_associated_allocator(completion_handler); + + + + + +* If `execution::is_executor::value` is true, constructs a function object wrapper `f` with a member `executor_` that is initialised with `prefer(ex1, execution::outstanding_work.tracked)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + std::move(function_)(); + auto a = get_associated_allocator(handler_); + prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); + + + + + +* If `execution::is_executor::value` is false, constructs a function object wrapper `f` with a member `work_` that is initialised with `make_work_guard(ex1)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + std::move(function_)(); + auto a = get_associated_allocator(handler_); + work_.get_executor().dispatch(std::move(handler_), a); + work_.reset(); + + + + + +* If `execution::is_executor::value` is true, performs + + prefer( + require(ex, execution::blocking.never), + execution::relationship.fork, + execution::allocator(alloc) + ).execute(std::move(f)); + + + + + +* If `execution::is_executor::value` is false, performs + + ex.dispatch(std::move(f), alloc); + + + + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void() + + + + + + + +[endsect] + + + +[section:overload5 dispatch (5 of 7 overloads)] + + +Submits a function to be run on a specified target executor, and passes the result to a completion handler. + + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename CompletionToken = default_completion_token_t> + auto dispatch( + Function && function, + const Executor & ex, + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + + +This function submits a function object for execution using the specified executor. The function object may be called from the current thread prior to returning from `dispatch()`. Otherwise, it is queued for execution. After the submitted function completes, the completion handler is dispatched along with the function's result, to run on its associated executor. + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ex][The target executor.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(decay_t()>>); +`` +]] + +] + + +[heading Return Value] + +This function returns `async_initiate(Init{ex}, token)`, where `Init` is a function object type defined as: + + + + class Init + { + public: + using executor_type = Executor; + explicit Init(const Executor& ex) : ex_(ex) {} + executor_type get_executor() const noexcept { return ex_; } + template + void operator()(CompletionHandler&& completion_handler, + Function&& function) const; + private: + Executor ex_; // exposition only + }; + + + + +The function call operator of `Init:` + + +* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing + + auto ex1 = get_associated_executor(completion_handler, ex); + + + + + +* Obtains the handler's associated allocator object `alloc` by performing + + auto alloc = get_associated_allocator(completion_handler); + + + + + +* If `execution::is_executor::value` is true, constructs a function object wrapper `f` with a member `executor_` that is initialised with `prefer(ex1, execution::outstanding_work.tracked)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + auto result = std::move(function_)(); + auto a = get_associated_allocator(handler_); + prefer(executor_, execution::allocator(a)).execute( + std::bind(std::move(handler_), std::move(result))); + + + + + +* If `execution::is_executor::value` is false, constructs a function object wrapper `f` with a member `work_` that is initialised with `make_work_guard(ex1)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + auto result = std::move(function_)(); + auto a = get_associated_allocator(handler_); + work_.get_executor().dispatch( + std::bind(std::move(handler_), std::move(result)), a); + work_.reset(); + + + + + +* If `execution::is_executor::value` is true, performs + + prefer( + require(ex, execution::blocking.never), + execution::relationship.fork, + execution::allocator(alloc) + ).execute(std::move(f)); + + + + + +* If `execution::is_executor::value` is false, performs + + ex.dispatch(std::move(f), alloc); + + + + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void(decay_t()>>) + + + + + + + +[endsect] + + + +[section:overload6 dispatch (6 of 7 overloads)] + + +Submits a function to be run on a specified execution context, and after completion submits the completion handler. + + + template< + typename Function, + typename ExecutionContext, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto dispatch( + Function && function, + ExecutionContext & ctx, + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ctx][An execution context, from which the target executor is obtained.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(); +`` +]] + +] + + +[heading Return Value] + +`dispatch(forward(function), ctx.get_executor(), forward(token))`. + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void() + + + + + + + +[endsect] + + + +[section:overload7 dispatch (7 of 7 overloads)] + + +Submits a function to be run on a specified execution context, and passes the result to a completion handler. + + + template< + typename Function, + typename ExecutionContext, + typename CompletionToken = default_completion_token_t> + auto dispatch( + Function && function, + ExecutionContext & ctx, + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ctx][An execution context, from which the target executor is obtained.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(); +`` +]] + +] + + +[heading Return Value] + +`dispatch(forward(function), ctx.get_executor(), forward(token))`. + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void(decay_t()>>) + + + + + + + [endsect] @@ -92798,6 +94107,889 @@ The type returned by queries against an `any_executor`. +[endsect] + + +[section:execution__inline_exception_handling execution::inline_exception_handling] + +[indexterm1 boost_asio.indexterm.execution__inline_exception_handling..execution::inline_exception_handling] + +A special value used for accessing the inline\_exception\_handling property. + + + constexpr inline_exception_handling_t inline_exception_handling; + + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[endsect] + + +[section:execution__inline_exception_handling_t execution::inline_exception_handling_t] + +[indexterm1 boost_asio.indexterm.execution__inline_exception_handling_t..execution::inline_exception_handling_t] + + +A property to describe what guarantees an executor makes about the treatment of exceptions that are thrown by a submitted function, when that function is executed inline within `execute`. + + + struct inline_exception_handling_t + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.execution__inline_exception_handling_t__capture_t [*capture_t]]] + [A sub-property that indicates that invocation of an executor's execution function will capture any exceptions that are thrown by the submitted function object, if that function object is executed inline. Captured exceptions are forwarded to an executor-defined handling mechanism. ] + + ] + + [ + + [[link boost_asio.reference.execution__inline_exception_handling_t__propagate_t [*propagate_t]]] + [A sub-property that indicates that invocation of an executor's execution function will propagate any exceptions that are thrown by the submitted function object, if that function object is executed inline. ] + + ] + + [ + + [[link boost_asio.reference.execution__inline_exception_handling_t__terminate_t [*terminate_t]]] + [A sub-property that indicates that invocation of an executor's execution function will terminate the program if any exceptions that are thrown by the submitted function object, if that function object is executed inline. ] + + ] + + [ + + [[link boost_asio.reference.execution__inline_exception_handling_t.polymorphic_query_result_type [*polymorphic_query_result_type]]] + [The type returned by queries against an any_executor. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t.inline_exception_handling_t [*inline_exception_handling_t]] [constructor]] + [Default constructor. + [hr] + Construct from a sub-property value. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t.capture [*capture]] [static]] + [A special value used for accessing the inline_exception_handling_t::capture_t property. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t.is_applicable_property_v [*is_applicable_property_v]] [static]] + [The inline_exception_handling property applies to executors. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t.is_preferable [*is_preferable]] [static]] + [The top-level inline_exception_handling property cannot be preferred. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t.is_requirable [*is_requirable]] [static]] + [The top-level inline_exception_handling property cannot be required. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t.propagate [*propagate]] [static]] + [A special value used for accessing the inline_exception_handling_t::propagate_t property. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t.terminate [*terminate]] [static]] + [A special value used for accessing the inline_exception_handling_t::terminate_t property. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t.operator_not__eq_ [*operator!=]]] + [Compare property values for inequality. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t.operator_eq__eq_ [*operator==]]] + [Compare property values for equality. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[section:capture execution::inline_exception_handling_t::capture] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.capture..capture..execution::inline_exception_handling_t] +A special value used for accessing the [link boost_asio.reference.execution__inline_exception_handling_t__capture_t `execution::inline_exception_handling_t::capture_t`] property. + + + static constexpr capture_t capture; + + + +[endsect] + + +[section:inline_exception_handling_t execution::inline_exception_handling_t::inline_exception_handling_t] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.inline_exception_handling_t..inline_exception_handling_t..execution::inline_exception_handling_t] +Default constructor. + + + constexpr ``[link boost_asio.reference.execution__inline_exception_handling_t.inline_exception_handling_t.overload1 inline_exception_handling_t]``(); + `` [''''»''' [link boost_asio.reference.execution__inline_exception_handling_t.inline_exception_handling_t.overload1 more...]]`` + + +Construct from a sub-property value. + + + constexpr ``[link boost_asio.reference.execution__inline_exception_handling_t.inline_exception_handling_t.overload2 inline_exception_handling_t]``( + propagate_t ); + `` [''''»''' [link boost_asio.reference.execution__inline_exception_handling_t.inline_exception_handling_t.overload2 more...]]`` + + constexpr ``[link boost_asio.reference.execution__inline_exception_handling_t.inline_exception_handling_t.overload3 inline_exception_handling_t]``( + capture_t ); + `` [''''»''' [link boost_asio.reference.execution__inline_exception_handling_t.inline_exception_handling_t.overload3 more...]]`` + + constexpr ``[link boost_asio.reference.execution__inline_exception_handling_t.inline_exception_handling_t.overload4 inline_exception_handling_t]``( + terminate_t ); + `` [''''»''' [link boost_asio.reference.execution__inline_exception_handling_t.inline_exception_handling_t.overload4 more...]]`` + + +[section:overload1 execution::inline_exception_handling_t::inline_exception_handling_t (1 of 4 overloads)] + + +Default constructor. + + + constexpr inline_exception_handling_t(); + + + +[endsect] + + + +[section:overload2 execution::inline_exception_handling_t::inline_exception_handling_t (2 of 4 overloads)] + + +Construct from a sub-property value. + + + constexpr inline_exception_handling_t( + propagate_t ); + + + +[endsect] + + + +[section:overload3 execution::inline_exception_handling_t::inline_exception_handling_t (3 of 4 overloads)] + + +Construct from a sub-property value. + + + constexpr inline_exception_handling_t( + capture_t ); + + + +[endsect] + + + +[section:overload4 execution::inline_exception_handling_t::inline_exception_handling_t (4 of 4 overloads)] + + +Construct from a sub-property value. + + + constexpr inline_exception_handling_t( + terminate_t ); + + + +[endsect] + + +[endsect] + + +[section:is_applicable_property_v execution::inline_exception_handling_t::is_applicable_property_v] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.is_applicable_property_v..is_applicable_property_v..execution::inline_exception_handling_t] +The inline\_exception\_handling property applies to executors. + + + template + static constexpr bool is_applicable_property_v = is_executor_v; + + + +[endsect] + + + +[section:is_preferable execution::inline_exception_handling_t::is_preferable] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.is_preferable..is_preferable..execution::inline_exception_handling_t] +The top-level inline\_exception\_handling property cannot be preferred. + + + static constexpr bool is_preferable = false; + + + +[endsect] + + + +[section:is_requirable execution::inline_exception_handling_t::is_requirable] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.is_requirable..is_requirable..execution::inline_exception_handling_t] +The top-level inline\_exception\_handling property cannot be required. + + + static constexpr bool is_requirable = false; + + + +[endsect] + + + +[section:operator_not__eq_ execution::inline_exception_handling_t::operator!=] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.operator_not__eq_..operator!=..execution::inline_exception_handling_t] +Compare property values for inequality. + + + constexpr bool operator!=( + const inline_exception_handling_t & a, + const inline_exception_handling_t & b); + + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[endsect] + + + +[section:operator_eq__eq_ execution::inline_exception_handling_t::operator==] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.operator_eq__eq_..operator==..execution::inline_exception_handling_t] +Compare property values for equality. + + + constexpr bool operator==( + const inline_exception_handling_t & a, + const inline_exception_handling_t & b); + + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[endsect] + + + +[section:polymorphic_query_result_type execution::inline_exception_handling_t::polymorphic_query_result_type] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.polymorphic_query_result_type..polymorphic_query_result_type..execution::inline_exception_handling_t] +The type returned by queries against an `any_executor`. + + + typedef inline_exception_handling_t polymorphic_query_result_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[endsect] + + + +[section:propagate execution::inline_exception_handling_t::propagate] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.propagate..propagate..execution::inline_exception_handling_t] +A special value used for accessing the [link boost_asio.reference.execution__inline_exception_handling_t__propagate_t `execution::inline_exception_handling_t::propagate_t`] property. + + + static constexpr propagate_t propagate; + + + +[endsect] + + + +[section:terminate execution::inline_exception_handling_t::terminate] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t.terminate..terminate..execution::inline_exception_handling_t] +A special value used for accessing the [link boost_asio.reference.execution__inline_exception_handling_t__terminate_t `execution::inline_exception_handling_t::terminate_t`] property. + + + static constexpr terminate_t terminate; + + + +[endsect] + + + +[endsect] + +[section:execution__inline_exception_handling_t__capture_t execution::inline_exception_handling_t::capture_t] + +[indexterm1 boost_asio.indexterm.execution__inline_exception_handling_t__capture_t..execution::inline_exception_handling_t::capture_t] + + +A sub-property that indicates that invocation of an executor's execution function will capture any exceptions that are thrown by the submitted function object, if that function object is executed inline. Captured exceptions are forwarded to an executor-defined handling mechanism. + + + struct capture_t + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.execution__inline_exception_handling_t__capture_t.polymorphic_query_result_type [*polymorphic_query_result_type]]] + [The type returned by queries against an any_executor. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__capture_t.capture_t [*capture_t]] [constructor]] + [Default constructor. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__capture_t.value [*value]] [static]] + [Get the value associated with a property object. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__capture_t.is_applicable_property_v [*is_applicable_property_v]] [static]] + [The inline_exception_handling_t::capture_t property applies to executors. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__capture_t.is_preferable [*is_preferable]] [static]] + [The inline_exception_handling_t::capture_t property can be preferred. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__capture_t.is_requirable [*is_requirable]] [static]] + [The inline_exception_handling_t::capture_t property can be required. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[section:capture_t execution::inline_exception_handling_t::capture_t::capture_t] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__capture_t.capture_t..capture_t..execution::inline_exception_handling_t::capture_t] +Default constructor. + + + constexpr capture_t(); + + + +[endsect] + + + +[section:is_applicable_property_v execution::inline_exception_handling_t::capture_t::is_applicable_property_v] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__capture_t.is_applicable_property_v..is_applicable_property_v..execution::inline_exception_handling_t::capture_t] +The [link boost_asio.reference.execution__inline_exception_handling_t__capture_t `execution::inline_exception_handling_t::capture_t`] property applies to executors. + + + template + static constexpr bool is_applicable_property_v = is_executor_v; + + + +[endsect] + + + +[section:is_preferable execution::inline_exception_handling_t::capture_t::is_preferable] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__capture_t.is_preferable..is_preferable..execution::inline_exception_handling_t::capture_t] +The [link boost_asio.reference.execution__inline_exception_handling_t__capture_t `execution::inline_exception_handling_t::capture_t`] property can be preferred. + + + static constexpr bool is_preferable = false; + + + +[endsect] + + + +[section:is_requirable execution::inline_exception_handling_t::capture_t::is_requirable] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__capture_t.is_requirable..is_requirable..execution::inline_exception_handling_t::capture_t] +The [link boost_asio.reference.execution__inline_exception_handling_t__capture_t `execution::inline_exception_handling_t::capture_t`] property can be required. + + + static constexpr bool is_requirable = true; + + + +[endsect] + + + +[section:polymorphic_query_result_type execution::inline_exception_handling_t::capture_t::polymorphic_query_result_type] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__capture_t.polymorphic_query_result_type..polymorphic_query_result_type..execution::inline_exception_handling_t::capture_t] +The type returned by queries against an `any_executor`. + + + typedef inline_exception_handling_t polymorphic_query_result_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[endsect] + + + +[section:value execution::inline_exception_handling_t::capture_t::value] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__capture_t.value..value..execution::inline_exception_handling_t::capture_t] +Get the value associated with a property object. + + + static constexpr inline_exception_handling_t value(); + + + +[heading Return Value] + +`capture_t()`; + + + + +[endsect] + + + +[endsect] + +[section:execution__inline_exception_handling_t__propagate_t execution::inline_exception_handling_t::propagate_t] + +[indexterm1 boost_asio.indexterm.execution__inline_exception_handling_t__propagate_t..execution::inline_exception_handling_t::propagate_t] + + +A sub-property that indicates that invocation of an executor's execution function will propagate any exceptions that are thrown by the submitted function object, if that function object is executed inline. + + + struct propagate_t + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.execution__inline_exception_handling_t__propagate_t.polymorphic_query_result_type [*polymorphic_query_result_type]]] + [The type returned by queries against an any_executor. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__propagate_t.propagate_t [*propagate_t]] [constructor]] + [Default constructor. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__propagate_t.value [*value]] [static]] + [Get the value associated with a property object. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__propagate_t.is_applicable_property_v [*is_applicable_property_v]] [static]] + [The inline_exception_handling_t::propagate_t property applies to executors. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__propagate_t.is_preferable [*is_preferable]] [static]] + [The inline_exception_handling_t::propagate_t property can be preferred. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__propagate_t.is_requirable [*is_requirable]] [static]] + [The inline_exception_handling_t::propagate_t property can be required. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[section:is_applicable_property_v execution::inline_exception_handling_t::propagate_t::is_applicable_property_v] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__propagate_t.is_applicable_property_v..is_applicable_property_v..execution::inline_exception_handling_t::propagate_t] +The [link boost_asio.reference.execution__inline_exception_handling_t__propagate_t `execution::inline_exception_handling_t::propagate_t`] property applies to executors. + + + template + static constexpr bool is_applicable_property_v = is_executor_v; + + + +[endsect] + + + +[section:is_preferable execution::inline_exception_handling_t::propagate_t::is_preferable] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__propagate_t.is_preferable..is_preferable..execution::inline_exception_handling_t::propagate_t] +The [link boost_asio.reference.execution__inline_exception_handling_t__propagate_t `execution::inline_exception_handling_t::propagate_t`] property can be preferred. + + + static constexpr bool is_preferable = true; + + + +[endsect] + + + +[section:is_requirable execution::inline_exception_handling_t::propagate_t::is_requirable] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__propagate_t.is_requirable..is_requirable..execution::inline_exception_handling_t::propagate_t] +The [link boost_asio.reference.execution__inline_exception_handling_t__propagate_t `execution::inline_exception_handling_t::propagate_t`] property can be required. + + + static constexpr bool is_requirable = true; + + + +[endsect] + + + +[section:polymorphic_query_result_type execution::inline_exception_handling_t::propagate_t::polymorphic_query_result_type] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__propagate_t.polymorphic_query_result_type..polymorphic_query_result_type..execution::inline_exception_handling_t::propagate_t] +The type returned by queries against an `any_executor`. + + + typedef inline_exception_handling_t polymorphic_query_result_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[endsect] + + + +[section:propagate_t execution::inline_exception_handling_t::propagate_t::propagate_t] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__propagate_t.propagate_t..propagate_t..execution::inline_exception_handling_t::propagate_t] +Default constructor. + + + constexpr propagate_t(); + + + +[endsect] + + + +[section:value execution::inline_exception_handling_t::propagate_t::value] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__propagate_t.value..value..execution::inline_exception_handling_t::propagate_t] +Get the value associated with a property object. + + + static constexpr inline_exception_handling_t value(); + + + +[heading Return Value] + +`propagate_t()`; + + + + +[endsect] + + + +[endsect] + +[section:execution__inline_exception_handling_t__terminate_t execution::inline_exception_handling_t::terminate_t] + +[indexterm1 boost_asio.indexterm.execution__inline_exception_handling_t__terminate_t..execution::inline_exception_handling_t::terminate_t] + + +A sub-property that indicates that invocation of an executor's execution function will terminate the program if any exceptions that are thrown by the submitted function object, if that function object is executed inline. + + + struct terminate_t + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.execution__inline_exception_handling_t__terminate_t.polymorphic_query_result_type [*polymorphic_query_result_type]]] + [The type returned by queries against an any_executor. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__terminate_t.terminate_t [*terminate_t]] [constructor]] + [Default constructor. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__terminate_t.value [*value]] [static]] + [Get the value associated with a property object. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__terminate_t.is_applicable_property_v [*is_applicable_property_v]] [static]] + [The inline_exception_handling_t::terminate_t property applies to executors. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__terminate_t.is_preferable [*is_preferable]] [static]] + [The inline_exception_handling_t::terminate_t property can be preferred. ] + ] + + [ + [[link boost_asio.reference.execution__inline_exception_handling_t__terminate_t.is_requirable [*is_requirable]] [static]] + [The inline_exception_handling_t::terminate_t property can be required. ] + ] + +] + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[section:is_applicable_property_v execution::inline_exception_handling_t::terminate_t::is_applicable_property_v] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__terminate_t.is_applicable_property_v..is_applicable_property_v..execution::inline_exception_handling_t::terminate_t] +The [link boost_asio.reference.execution__inline_exception_handling_t__terminate_t `execution::inline_exception_handling_t::terminate_t`] property applies to executors. + + + template + static constexpr bool is_applicable_property_v = is_executor_v; + + + +[endsect] + + + +[section:is_preferable execution::inline_exception_handling_t::terminate_t::is_preferable] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__terminate_t.is_preferable..is_preferable..execution::inline_exception_handling_t::terminate_t] +The [link boost_asio.reference.execution__inline_exception_handling_t__terminate_t `execution::inline_exception_handling_t::terminate_t`] property can be preferred. + + + static constexpr bool is_preferable = true; + + + +[endsect] + + + +[section:is_requirable execution::inline_exception_handling_t::terminate_t::is_requirable] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__terminate_t.is_requirable..is_requirable..execution::inline_exception_handling_t::terminate_t] +The [link boost_asio.reference.execution__inline_exception_handling_t__terminate_t `execution::inline_exception_handling_t::terminate_t`] property can be required. + + + static constexpr bool is_requirable = true; + + + +[endsect] + + + +[section:polymorphic_query_result_type execution::inline_exception_handling_t::terminate_t::polymorphic_query_result_type] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__terminate_t.polymorphic_query_result_type..polymorphic_query_result_type..execution::inline_exception_handling_t::terminate_t] +The type returned by queries against an `any_executor`. + + + typedef inline_exception_handling_t polymorphic_query_result_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/execution/inline_exception_handling.hpp] + +['Convenience header: ][^boost/asio/execution.hpp] + + +[endsect] + + + +[section:terminate_t execution::inline_exception_handling_t::terminate_t::terminate_t] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__terminate_t.terminate_t..terminate_t..execution::inline_exception_handling_t::terminate_t] +Default constructor. + + + constexpr terminate_t(); + + + +[endsect] + + + +[section:value execution::inline_exception_handling_t::terminate_t::value] + +[indexterm2 boost_asio.indexterm.execution__inline_exception_handling_t__terminate_t.value..value..execution::inline_exception_handling_t::terminate_t] +Get the value associated with a property object. + + + static constexpr inline_exception_handling_t value(); + + + +[heading Return Value] + +`terminate_t()`; + + + + +[endsect] + + + [endsect] [section:execution__invocable_archetype execution::invocable_archetype] @@ -112319,6 +114511,1270 @@ Destructor. +[endsect] + + +[section:inline_executor inline_executor] + +[indexterm1 boost_asio.indexterm.inline_executor..inline_executor] + +An executor that always executes the function object inline. + + + typedef basic_inline_executor< execution::inline_exception_handling_t::propagate_t > inline_executor; + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_inline_executor.basic_inline_executor [*basic_inline_executor]] [constructor]] + [Default constructor. ] + ] + + [ + [[link boost_asio.reference.basic_inline_executor.execute [*execute]]] + [Execution function. ] + ] + + [ + [[link boost_asio.reference.basic_inline_executor.query__static [*query]] [static]] + [Query the current value of the mapping property. + [hr] + Query the current value of the inline_exception_handling property. + [hr] + Query the current value of the blocking property. ] + ] + + [ + [[link boost_asio.reference.basic_inline_executor.require [*require]]] + [Obtain an executor with the inline_exception_handling.propagate property. + [hr] + Obtain an executor with the inline_exception_handling.terminate property. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.basic_inline_executor.operator_not__eq_ [*operator!=]]] + [Compare two executors for inequality. ] + ] + + [ + [[link boost_asio.reference.basic_inline_executor.operator_eq__eq_ [*operator==]]] + [Compare two executors for equality. ] + ] + +] + + +[heading Requirements] + +['Header: ][^boost/asio/inline_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[section:inline_or inline_or] + +[indexterm1 boost_asio.indexterm.inline_or..inline_or] + +The [link boost_asio.reference.inline_or `inline_or`] function creates an [link boost_asio.reference.inline_or_executor `inline_or_executor`] object for an executor or execution context. + + +Create an [link boost_asio.reference.inline_or_executor `inline_or_executor`] object for an executor. + + template< + typename ``[link boost_asio.reference.Executor1 Executor]``> + inline_or_executor< Executor > ``[link boost_asio.reference.inline_or.overload1 inline_or]``( + const Executor & ex, + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); + `` [''''»''' [link boost_asio.reference.inline_or.overload1 more...]]`` + +Create an [link boost_asio.reference.inline_or_executor `inline_or_executor`] object for an execution context. + + template< + typename ExecutionContext> + inline_or_executor< typename ExecutionContext::executor_type > ``[link boost_asio.reference.inline_or.overload2 inline_or]``( + ExecutionContext & ctx, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + `` [''''»''' [link boost_asio.reference.inline_or.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^boost/asio/inline_or_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:overload1 inline_or (1 of 2 overloads)] + + +Create an [link boost_asio.reference.inline_or_executor `inline_or_executor`] object for an executor. + + + template< + typename ``[link boost_asio.reference.Executor1 Executor]``> + inline_or_executor< Executor > inline_or( + const Executor & ex, + constraint_t< is_executor< Executor >::value||execution::is_executor< Executor >::value > = 0); + + + +[heading Parameters] + + +[variablelist + +[[ex][An executor.]] + +] + + +[heading Return Value] + +An [link boost_asio.reference.inline_or_executor `inline_or_executor`] constructed with the specified executor. + + + + +[endsect] + + + +[section:overload2 inline_or (2 of 2 overloads)] + + +Create an [link boost_asio.reference.inline_or_executor `inline_or_executor`] object for an execution context. + + + template< + typename ExecutionContext> + inline_or_executor< typename ExecutionContext::executor_type > inline_or( + ExecutionContext & ctx, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + + + +[heading Parameters] + + +[variablelist + +[[ctx][An execution context, from which an executor will be obtained.]] + +] + + +[heading Return Value] + +An [link boost_asio.reference.inline_or_executor `inline_or_executor`] constructed with the execution context's executor, obtained by performing `ctx.get_executor()`. + + + + +[endsect] + + +[endsect] + +[section:inline_or_executor inline_or_executor] + +[indexterm1 boost_asio.indexterm.inline_or_executor..inline_or_executor] + + +Adapts an executor to add inline invocation of the submitted function. + + + template< + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename Blocking = execution::blocking_t::always_t, + typename InlineExceptionHandling = execution::inline_exception_handling_t::propagate_t> + class inline_or_executor + + +[heading Types] +[table + [[Name][Description]] + + [ + + [[link boost_asio.reference.inline_or_executor.inner_executor_type [*inner_executor_type]]] + [The type of the underlying executor. ] + + ] + +] + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.inline_or_executor.context [*context]]] + [Obtain the underlying execution context. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.defer [*defer]]] + [Request the inline_or_executor to invoke the given function object. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.dispatch [*dispatch]]] + [Request the inline_or_executor to invoke the given function object. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.execute [*execute]]] + [Request the inline_or_executor to invoke the given function object. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.get_inner_executor [*get_inner_executor]]] + [Obtain the underlying executor. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.inline_or_executor [*inline_or_executor]] [constructor]] + [Default constructor. + [hr] + Construct an inline_or_executor for the specified executor. + [hr] + Copy constructor. + [hr] + Converting constructor. + [hr] + Move constructor. + [hr] + Converting move constructor. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.on_work_finished [*on_work_finished]]] + [Inform the inline_or_executor that some work is no longer outstanding. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.on_work_started [*on_work_started]]] + [Inform the inline_or_executor that it has some outstanding work to do. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.operator_eq_ [*operator=]]] + [Assignment operator. + [hr] + Converting assignment operator. + [hr] + Move assignment operator. + [hr] + Converting move assignment operator. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.post [*post]]] + [Request the inline_or_executor to invoke the given function object. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.prefer [*prefer]]] + [Forward a preference to the underlying executor. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.query [*query]]] + [Forward a query to the underlying executor. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.query__static [*query]] [static]] + [Query the current value of the blocking property. + [hr] + Query the current value of the inline_exception_handling property. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.require [*require]]] + [Obtain an executor with the blocking.possibly property. + [hr] + Obtain an executor with the blocking.always property. + [hr] + Obtain an executor with the blocking.never property. + [hr] + Obtain an executor with the inline_exception_handling.propagate property. + [hr] + Obtain an executor with the inline_exception_handling.terminate property. + [hr] + Forward a requirement to the underlying executor. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor._inline_or_executor [*~inline_or_executor]] [destructor]] + [Destructor. ] + ] + +] + +[heading Friends] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.inline_or_executor.operator_not__eq_ [*operator!=]]] + [Compare two inline_or_executors for inequality. ] + ] + + [ + [[link boost_asio.reference.inline_or_executor.operator_eq__eq_ [*operator==]]] + [Compare two inline_or_executors for equality. ] + ] + +] + +The @inline\_or\_executor class template adapts an existing executor such that: + + +* posted function objects (or when the `blocking` property is set to `blocking.never`) are submitted to the wrapped executor; and + + +* dispatched function objects (or when `blocking` is `blocking.always` or `blocking.possibly`) are executed inline. + + + +[heading Requirements] + +['Header: ][^boost/asio/inline_or_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:context inline_or_executor::context] + +[indexterm2 boost_asio.indexterm.inline_or_executor.context..context..inline_or_executor] +Obtain the underlying execution context. + + + execution_context & context() const; + + + +[endsect] + + + +[section:defer inline_or_executor::defer] + +[indexterm2 boost_asio.indexterm.inline_or_executor.defer..defer..inline_or_executor] +Request the [link boost_asio.reference.inline_or_executor `inline_or_executor`] to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void defer( + Function && f, + const Allocator & a) const; + + +This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled by the underlying executor's defer function. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:dispatch inline_or_executor::dispatch] + +[indexterm2 boost_asio.indexterm.inline_or_executor.dispatch..dispatch..inline_or_executor] +Request the [link boost_asio.reference.inline_or_executor `inline_or_executor`] to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void dispatch( + Function && f, + const Allocator & a) const; + + +This function is used to ask the [link boost_asio.reference.inline_or_executor `inline_or_executor`] to execute the given function object. The function object will be executed inside this function. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:execute inline_or_executor::execute] + +[indexterm2 boost_asio.indexterm.inline_or_executor.execute..execute..inline_or_executor] +Request the [link boost_asio.reference.inline_or_executor `inline_or_executor`] to invoke the given function object. + + + template< + typename Function> + constraint_t< traits::execute_member< const Executor &, Function >::is_valid, void > execute( + Function && f) const; + + +This function is used to ask the [link boost_asio.reference.inline_or_executor `inline_or_executor`] to execute the given function object. The function object will be executed inline or according to the properties of the underlying executor. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +] + + + + +[endsect] + + + +[section:get_inner_executor inline_or_executor::get_inner_executor] + +[indexterm2 boost_asio.indexterm.inline_or_executor.get_inner_executor..get_inner_executor..inline_or_executor] +Obtain the underlying executor. + + + inner_executor_type get_inner_executor() const; + + + +[endsect] + + +[section:inline_or_executor inline_or_executor::inline_or_executor] + +[indexterm2 boost_asio.indexterm.inline_or_executor.inline_or_executor..inline_or_executor..inline_or_executor] +Default constructor. + + + ``[link boost_asio.reference.inline_or_executor.inline_or_executor.overload1 inline_or_executor]``(); + `` [''''»''' [link boost_asio.reference.inline_or_executor.inline_or_executor.overload1 more...]]`` + + +Construct an [link boost_asio.reference.inline_or_executor `inline_or_executor`] for the specified executor. + + + template< + typename ``[link boost_asio.reference.Executor1 Executor1]``> + explicit ``[link boost_asio.reference.inline_or_executor.inline_or_executor.overload2 inline_or_executor]``( + const Executor1 & e, + constraint_t< conditional_t< !is_same< Executor1, inline_or_executor >::value, is_convertible< Executor1, Executor >, false_type >::value > = 0); + `` [''''»''' [link boost_asio.reference.inline_or_executor.inline_or_executor.overload2 more...]]`` + + +Copy constructor. + + + ``[link boost_asio.reference.inline_or_executor.inline_or_executor.overload3 inline_or_executor]``( + const inline_or_executor & other); + `` [''''»''' [link boost_asio.reference.inline_or_executor.inline_or_executor.overload3 more...]]`` + + +Converting constructor. + + + template< + class ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.inline_or_executor.inline_or_executor.overload4 inline_or_executor]``( + const inline_or_executor< OtherExecutor > & other); + `` [''''»''' [link boost_asio.reference.inline_or_executor.inline_or_executor.overload4 more...]]`` + + +Move constructor. + + + ``[link boost_asio.reference.inline_or_executor.inline_or_executor.overload5 inline_or_executor]``( + inline_or_executor && other); + `` [''''»''' [link boost_asio.reference.inline_or_executor.inline_or_executor.overload5 more...]]`` + + +Converting move constructor. + + + template< + class ``[link boost_asio.reference.Executor1 OtherExecutor]``> + ``[link boost_asio.reference.inline_or_executor.inline_or_executor.overload6 inline_or_executor]``( + inline_or_executor< OtherExecutor > && other); + `` [''''»''' [link boost_asio.reference.inline_or_executor.inline_or_executor.overload6 more...]]`` + + +[section:overload1 inline_or_executor::inline_or_executor (1 of 6 overloads)] + + +Default constructor. + + + inline_or_executor(); + + +This constructor is only valid if the underlying executor type is default constructible. + + +[endsect] + + + +[section:overload2 inline_or_executor::inline_or_executor (2 of 6 overloads)] + + +Construct an [link boost_asio.reference.inline_or_executor `inline_or_executor`] for the specified executor. + + + template< + typename ``[link boost_asio.reference.Executor1 Executor1]``> + inline_or_executor( + const Executor1 & e, + constraint_t< conditional_t< !is_same< Executor1, inline_or_executor >::value, is_convertible< Executor1, Executor >, false_type >::value > = 0); + + + +[endsect] + + + +[section:overload3 inline_or_executor::inline_or_executor (3 of 6 overloads)] + + +Copy constructor. + + + inline_or_executor( + const inline_or_executor & other); + + + +[endsect] + + + +[section:overload4 inline_or_executor::inline_or_executor (4 of 6 overloads)] + + +Converting constructor. + + + template< + class ``[link boost_asio.reference.Executor1 OtherExecutor]``> + inline_or_executor( + const inline_or_executor< OtherExecutor > & other); + + +This constructor is only valid if the `OtherExecutor` type is convertible to `Executor`. + + +[endsect] + + + +[section:overload5 inline_or_executor::inline_or_executor (5 of 6 overloads)] + + +Move constructor. + + + inline_or_executor( + inline_or_executor && other); + + + +[endsect] + + + +[section:overload6 inline_or_executor::inline_or_executor (6 of 6 overloads)] + + +Converting move constructor. + + + template< + class ``[link boost_asio.reference.Executor1 OtherExecutor]``> + inline_or_executor( + inline_or_executor< OtherExecutor > && other); + + +This constructor is only valid if the `OtherExecutor` type is convertible to `Executor`. + + +[endsect] + + +[endsect] + + +[section:inner_executor_type inline_or_executor::inner_executor_type] + +[indexterm2 boost_asio.indexterm.inline_or_executor.inner_executor_type..inner_executor_type..inline_or_executor] +The type of the underlying executor. + + + typedef Executor inner_executor_type; + + + +[heading Requirements] + +['Header: ][^boost/asio/inline_or_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:on_work_finished inline_or_executor::on_work_finished] + +[indexterm2 boost_asio.indexterm.inline_or_executor.on_work_finished..on_work_finished..inline_or_executor] +Inform the [link boost_asio.reference.inline_or_executor `inline_or_executor`] that some work is no longer outstanding. + + + void on_work_finished() const; + + +The [link boost_asio.reference.inline_or_executor `inline_or_executor`] delegates this call to its underlying executor. + + +[endsect] + + + +[section:on_work_started inline_or_executor::on_work_started] + +[indexterm2 boost_asio.indexterm.inline_or_executor.on_work_started..on_work_started..inline_or_executor] +Inform the [link boost_asio.reference.inline_or_executor `inline_or_executor`] that it has some outstanding work to do. + + + void on_work_started() const; + + +The [link boost_asio.reference.inline_or_executor `inline_or_executor`] delegates this call to its underlying executor. + + +[endsect] + + + +[section:operator_not__eq_ inline_or_executor::operator!=] + +[indexterm2 boost_asio.indexterm.inline_or_executor.operator_not__eq_..operator!=..inline_or_executor] +Compare two inline\_or\_executors for inequality. + + + bool operator!=( + const inline_or_executor & a, + const inline_or_executor & b); + + +Two inline\_or\_executors are equal if their underlying executors are equal. + +[heading Requirements] + +['Header: ][^boost/asio/inline_or_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + +[section:operator_eq_ inline_or_executor::operator=] + +[indexterm2 boost_asio.indexterm.inline_or_executor.operator_eq_..operator=..inline_or_executor] +Assignment operator. + + + inline_or_executor & ``[link boost_asio.reference.inline_or_executor.operator_eq_.overload1 operator=]``( + const inline_or_executor & other); + `` [''''»''' [link boost_asio.reference.inline_or_executor.operator_eq_.overload1 more...]]`` + + +Converting assignment operator. + + + template< + class ``[link boost_asio.reference.Executor1 OtherExecutor]``> + inline_or_executor & ``[link boost_asio.reference.inline_or_executor.operator_eq_.overload2 operator=]``( + const inline_or_executor< OtherExecutor > & other); + `` [''''»''' [link boost_asio.reference.inline_or_executor.operator_eq_.overload2 more...]]`` + + +Move assignment operator. + + + inline_or_executor & ``[link boost_asio.reference.inline_or_executor.operator_eq_.overload3 operator=]``( + inline_or_executor && other); + `` [''''»''' [link boost_asio.reference.inline_or_executor.operator_eq_.overload3 more...]]`` + + +Converting move assignment operator. + + + template< + class ``[link boost_asio.reference.Executor1 OtherExecutor]``> + inline_or_executor & ``[link boost_asio.reference.inline_or_executor.operator_eq_.overload4 operator=]``( + inline_or_executor< OtherExecutor > && other); + `` [''''»''' [link boost_asio.reference.inline_or_executor.operator_eq_.overload4 more...]]`` + + +[section:overload1 inline_or_executor::operator= (1 of 4 overloads)] + + +Assignment operator. + + + inline_or_executor & operator=( + const inline_or_executor & other); + + + +[endsect] + + + +[section:overload2 inline_or_executor::operator= (2 of 4 overloads)] + + +Converting assignment operator. + + + template< + class ``[link boost_asio.reference.Executor1 OtherExecutor]``> + inline_or_executor & operator=( + const inline_or_executor< OtherExecutor > & other); + + +This assignment operator is only valid if the `OtherExecutor` type is convertible to `Executor`. + + +[endsect] + + + +[section:overload3 inline_or_executor::operator= (3 of 4 overloads)] + + +Move assignment operator. + + + inline_or_executor & operator=( + inline_or_executor && other); + + + +[endsect] + + + +[section:overload4 inline_or_executor::operator= (4 of 4 overloads)] + + +Converting move assignment operator. + + + template< + class ``[link boost_asio.reference.Executor1 OtherExecutor]``> + inline_or_executor & operator=( + inline_or_executor< OtherExecutor > && other); + + +This assignment operator is only valid if the `OtherExecutor` type is convertible to `Executor`. + + +[endsect] + + +[endsect] + + +[section:operator_eq__eq_ inline_or_executor::operator==] + +[indexterm2 boost_asio.indexterm.inline_or_executor.operator_eq__eq_..operator==..inline_or_executor] +Compare two inline\_or\_executors for equality. + + + bool operator==( + const inline_or_executor & a, + const inline_or_executor & b); + + +Two inline\_or\_executors are equal if their underlying executors are equal. + +[heading Requirements] + +['Header: ][^boost/asio/inline_or_executor.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[endsect] + + + +[section:post inline_or_executor::post] + +[indexterm2 boost_asio.indexterm.inline_or_executor.post..post..inline_or_executor] +Request the [link boost_asio.reference.inline_or_executor `inline_or_executor`] to invoke the given function object. + + + template< + typename Function, + typename Allocator> + void post( + Function && f, + const Allocator & a) const; + + +This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled by the underlying executor's post function. + + +[heading Parameters] + + +[variablelist + +[[f][The function object to be called. The executor will make a copy of the handler object as required. The function signature of the function object must be: +`` + void function(); +`` +]] + +[[a][An allocator that may be used by the executor to allocate the internal storage needed for function invocation. ]] + +] + + + + +[endsect] + + + +[section:prefer inline_or_executor::prefer] + +[indexterm2 boost_asio.indexterm.inline_or_executor.prefer..prefer..inline_or_executor] +Forward a preference to the underlying executor. + + + template< + typename Property> + inline_or_executor< decay_t< prefer_result_t< const Executor &, Property > >, Blocking, InlineExceptionHandling > prefer( + const Property & p, + constraint_t< can_prefer< const Executor &, Property >::value > = 0, + constraint_t< !is_convertible< Property, execution::blocking_t >::value > = 0, + constraint_t< !is_convertible< Property, execution::inline_exception_handling_t >::value > = 0) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.prefer `prefer`] customisation point. + +For example: + + boost::asio::inline_or_executor ex1 = ...; + auto ex2 = boost::asio::prefer(ex1, + boost::asio::execution::relationship.continuation); + + + + + +[endsect] + + + +[section:query inline_or_executor::query] + +[indexterm2 boost_asio.indexterm.inline_or_executor.query..query..inline_or_executor] +Forward a query to the underlying executor. + + + template< + typename Property> + query_result_t< const Executor &, Property > query( + const Property & p, + constraint_t< can_query< const Executor &, Property >::value > = 0, + constraint_t< !is_convertible< Property, execution::blocking_t >::value > = 0, + constraint_t< !is_convertible< Property, execution::inline_exception_handling_t >::value > = 0) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.query `query`] customisation point. + +For example: + + boost::asio::inline_or_executor ex = ...; + if (boost::asio::query(ex, boost::asio::execution::blocking) + == boost::asio::execution::blocking.never) + ... + + + + + +[endsect] + + +[section:query__static inline_or_executor::query] + +[indexterm2 boost_asio.indexterm.inline_or_executor.query__static..query..inline_or_executor] +Query the current value of the `blocking` property. + + + static constexpr execution::blocking_t ``[link boost_asio.reference.inline_or_executor.query__static.overload1 query]``( + execution::blocking_t ); + `` [''''»''' [link boost_asio.reference.inline_or_executor.query__static.overload1 more...]]`` + + +Query the current value of the `inline_exception_handling` property. + + + static constexpr execution::inline_exception_handling_t ``[link boost_asio.reference.inline_or_executor.query__static.overload2 query]``( + execution::inline_exception_handling_t ); + `` [''''»''' [link boost_asio.reference.inline_or_executor.query__static.overload2 more...]]`` + + +[section:overload1 inline_or_executor::query (1 of 2 overloads)] + + +Query the current value of the `blocking` property. + + + static constexpr execution::blocking_t query( + execution::blocking_t ); + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.query `query`] customisation point. + +For example: + + boost::asio::inline_or_executor ex = ...; + if (boost::asio::query(ex, boost::asio::execution::blocking) + == boost::asio::execution::blocking.possibly) + ... + + + + + +[endsect] + + + +[section:overload2 inline_or_executor::query (2 of 2 overloads)] + + +Query the current value of the `inline_exception_handling` property. + + + static constexpr execution::inline_exception_handling_t query( + execution::inline_exception_handling_t ); + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.query `query`] customisation point. + +For example: + + boost::asio::inline_or_executor ex = ...; + if (boost::asio::query(ex, + boost::asio::execution::inline_exception_handling) + == boost::asio::execution::inline_exception_handling.propagate) + ... + + + + + +[endsect] + + +[endsect] + +[section:require inline_or_executor::require] + +[indexterm2 boost_asio.indexterm.inline_or_executor.require..require..inline_or_executor] +Obtain an executor with the `blocking.possibly` property. + + + inline_or_executor< Executor, execution::blocking_t::possibly_t, InlineExceptionHandling > ``[link boost_asio.reference.inline_or_executor.require.overload1 require]``( + const execution::blocking_t::possibly_t & ) const; + `` [''''»''' [link boost_asio.reference.inline_or_executor.require.overload1 more...]]`` + + +Obtain an executor with the `blocking.always` property. + + + inline_or_executor< Executor, execution::blocking_t::always_t, InlineExceptionHandling > ``[link boost_asio.reference.inline_or_executor.require.overload2 require]``( + const execution::blocking_t::always_t & ) const; + `` [''''»''' [link boost_asio.reference.inline_or_executor.require.overload2 more...]]`` + + +Obtain an executor with the `blocking.never` property. + + + inline_or_executor< Executor, execution::blocking_t::never_t, InlineExceptionHandling > ``[link boost_asio.reference.inline_or_executor.require.overload3 require]``( + const execution::blocking_t::never_t & ) const; + `` [''''»''' [link boost_asio.reference.inline_or_executor.require.overload3 more...]]`` + + +Obtain an executor with the `inline_exception_handling.propagate` property. + + + inline_or_executor< Executor, Blocking, execution::inline_exception_handling_t::propagate_t > ``[link boost_asio.reference.inline_or_executor.require.overload4 require]``( + const execution::inline_exception_handling_t::propagate_t & ) const; + `` [''''»''' [link boost_asio.reference.inline_or_executor.require.overload4 more...]]`` + + +Obtain an executor with the `inline_exception_handling.terminate` property. + + + inline_or_executor< Executor, Blocking, execution::inline_exception_handling_t::terminate_t > ``[link boost_asio.reference.inline_or_executor.require.overload5 require]``( + const execution::inline_exception_handling_t::terminate_t & ) const; + `` [''''»''' [link boost_asio.reference.inline_or_executor.require.overload5 more...]]`` + + +Forward a requirement to the underlying executor. + + + template< + typename Property> + inline_or_executor< decay_t< require_result_t< const Executor &, Property > >, Blocking, InlineExceptionHandling > ``[link boost_asio.reference.inline_or_executor.require.overload6 require]``( + const Property & p, + constraint_t< can_require< const Executor &, Property >::value > = 0, + constraint_t< !is_convertible< Property, execution::blocking_t >::value > = 0, + constraint_t< !is_convertible< Property, execution::inline_exception_handling_t >::value > = 0) const; + `` [''''»''' [link boost_asio.reference.inline_or_executor.require.overload6 more...]]`` + + +[section:overload1 inline_or_executor::require (1 of 6 overloads)] + + +Obtain an executor with the `blocking.possibly` property. + + + inline_or_executor< Executor, execution::blocking_t::possibly_t, InlineExceptionHandling > require( + const execution::blocking_t::possibly_t & ) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.require `require`] customisation point. + +For example: + + boost::asio::inline_or_executor ex = ...; + auto ex2 = boost::asio::require(ex1, + boost::asio::execution::blocking.possibly); + + + + + +[endsect] + + + +[section:overload2 inline_or_executor::require (2 of 6 overloads)] + + +Obtain an executor with the `blocking.always` property. + + + inline_or_executor< Executor, execution::blocking_t::always_t, InlineExceptionHandling > require( + const execution::blocking_t::always_t & ) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.require `require`] customisation point. + +For example: + + boost::asio::inline_or_executor ex = ...; + auto ex2 = boost::asio::require(ex1, + boost::asio::execution::blocking.always); + + + + + +[endsect] + + + +[section:overload3 inline_or_executor::require (3 of 6 overloads)] + + +Obtain an executor with the `blocking.never` property. + + + inline_or_executor< Executor, execution::blocking_t::never_t, InlineExceptionHandling > require( + const execution::blocking_t::never_t & ) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.require `require`] customisation point. + +For example: + + boost::asio::inline_or_executor ex = ...; + auto ex2 = boost::asio::require(ex1, + boost::asio::execution::blocking.never); + + + + + +[endsect] + + + +[section:overload4 inline_or_executor::require (4 of 6 overloads)] + + +Obtain an executor with the `inline_exception_handling.propagate` property. + + + inline_or_executor< Executor, Blocking, execution::inline_exception_handling_t::propagate_t > require( + const execution::inline_exception_handling_t::propagate_t & ) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.require `require`] customisation point. + +For example: + + boost::asio::inline_or_executor ex = ...; + auto ex2 = boost::asio::require(ex1, + boost::asio::execution::inline_exception_handling.propagate); + + + + + +[endsect] + + + +[section:overload5 inline_or_executor::require (5 of 6 overloads)] + + +Obtain an executor with the `inline_exception_handling.terminate` property. + + + inline_or_executor< Executor, Blocking, execution::inline_exception_handling_t::terminate_t > require( + const execution::inline_exception_handling_t::terminate_t & ) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.require `require`] customisation point. + +For example: + + boost::asio::inline_or_executor ex = ...; + auto ex2 = boost::asio::require(ex1, + boost::asio::execution::inline_exception_handling.terminate); + + + + + +[endsect] + + + +[section:overload6 inline_or_executor::require (6 of 6 overloads)] + + +Forward a requirement to the underlying executor. + + + template< + typename Property> + inline_or_executor< decay_t< require_result_t< const Executor &, Property > >, Blocking, InlineExceptionHandling > require( + const Property & p, + constraint_t< can_require< const Executor &, Property >::value > = 0, + constraint_t< !is_convertible< Property, execution::blocking_t >::value > = 0, + constraint_t< !is_convertible< Property, execution::inline_exception_handling_t >::value > = 0) const; + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.require `require`] customisation point. + +For example: + + boost::asio::inline_or_executor ex1 = ...; + auto ex2 = boost::asio::require(ex1, + boost::asio::execution::relationship.continuation); + + + + + +[endsect] + + +[endsect] + + +[section:_inline_or_executor inline_or_executor::~inline_or_executor] + +[indexterm2 boost_asio.indexterm.inline_or_executor._inline_or_executor..~inline_or_executor..inline_or_executor] +Destructor. + + + ~inline_or_executor(); + + + +[endsect] + + + [endsect] [section:invalid_service_owner invalid_service_owner] @@ -112793,6 +116249,8 @@ Executor used to submit functions to an [link boost_asio.reference.io_context `i [ [[link boost_asio.reference.io_context__basic_executor_type.query__static [*query]] [static]] [Query the current value of the mapping property. + [hr] + Query the current value of the inline_exception_handling property. [hr] Query the current value of the outstanding_work property. ] ] @@ -113732,6 +117190,8 @@ Executor implementation type used to submit functions to an [link boost_asio.ref [ [[link boost_asio.reference.io_context__basic_executor_type.query__static [*query]] [static]] [Query the current value of the mapping property. + [hr] + Query the current value of the inline_exception_handling property. [hr] Query the current value of the outstanding_work property. ] ] @@ -114306,15 +117766,23 @@ Query the current value of the `mapping` property. `` [''''»''' [link boost_asio.reference.io_context__basic_executor_type.query__static.overload1 more...]]`` -Query the current value of the `outstanding_work` property. +Query the current value of the `inline_exception_handling` property. - static constexpr execution::outstanding_work_t ``[link boost_asio.reference.io_context__basic_executor_type.query__static.overload2 query]``( - execution::outstanding_work_t ); + static constexpr execution::inline_exception_handling_t ``[link boost_asio.reference.io_context__basic_executor_type.query__static.overload2 query]``( + execution::inline_exception_handling_t ); `` [''''»''' [link boost_asio.reference.io_context__basic_executor_type.query__static.overload2 more...]]`` -[section:overload1 io_context::basic_executor_type::query (1 of 2 overloads)] +Query the current value of the `outstanding_work` property. + + + static constexpr execution::outstanding_work_t ``[link boost_asio.reference.io_context__basic_executor_type.query__static.overload3 query]``( + execution::outstanding_work_t ); + `` [''''»''' [link boost_asio.reference.io_context__basic_executor_type.query__static.overload3 more...]]`` + + +[section:overload1 io_context::basic_executor_type::query (1 of 3 overloads)] Query the current value of the `mapping` property. @@ -114341,7 +117809,35 @@ For example: -[section:overload2 io_context::basic_executor_type::query (2 of 2 overloads)] +[section:overload2 io_context::basic_executor_type::query (2 of 3 overloads)] + + +Query the current value of the `inline_exception_handling` property. + + + static constexpr execution::inline_exception_handling_t query( + execution::inline_exception_handling_t ); + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.query `query`] customisation point. + +For example: + + auto ex = my_io_context.get_executor(); + if (boost::asio::query(ex, + boost::asio::execution::inline_exception_handling) + == boost::asio::execution::inline_exception_handling.capture) + ... + + + + + +[endsect] + + + +[section:overload3 io_context::basic_executor_type::query (3 of 3 overloads)] Query the current value of the `outstanding_work` property. @@ -138709,6 +142205,101 @@ Constructor that specifies associated executor. +[endsect] + +[section:partial_redirect_disposition partial_redirect_disposition] + +[indexterm1 boost_asio.indexterm.partial_redirect_disposition..partial_redirect_disposition] + + +A function object type that adapts a [link boost_asio.overview.model.completion_tokens completion token] to capture any disposition produced by an asynchronous operation to a variable. + + + template< + typename ``[link boost_asio.reference.Disposition Disposition]``> + class partial_redirect_disposition + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.partial_redirect_disposition.operator_lp__rp_ [*operator()]]] + [Adapt a completion token to specify that the completion handler should capture disposition values to a variable. ] + ] + + [ + [[link boost_asio.reference.partial_redirect_disposition.partial_redirect_disposition [*partial_redirect_disposition]] [constructor]] + [Constructor that specifies the variable used to capture disposition values. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.partial_redirect_disposition.d_ [*d_]]] + [] + ] + +] + +May also be used directly as a completion token, in which case it adapts the asynchronous operation's default completion token (or [link boost_asio.reference.deferred `deferred`] if no default is available). + +[heading Requirements] + +['Header: ][^boost/asio/redirect_disposition.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:d_ partial_redirect_disposition::d_] + +[indexterm2 boost_asio.indexterm.partial_redirect_disposition.d_..d_..partial_redirect_disposition] + + Disposition & d_; + + + +[endsect] + + + +[section:operator_lp__rp_ partial_redirect_disposition::operator()] + +[indexterm2 boost_asio.indexterm.partial_redirect_disposition.operator_lp__rp_..operator()..partial_redirect_disposition] +Adapt a [link boost_asio.overview.model.completion_tokens completion token] to specify that the completion handler should capture disposition values to a variable. + + + template< + typename CompletionToken> + constexpr redirect_disposition_t< decay_t< CompletionToken >, Disposition > operator()( + CompletionToken && completion_token) const; + + + +[endsect] + + + +[section:partial_redirect_disposition partial_redirect_disposition::partial_redirect_disposition] + +[indexterm2 boost_asio.indexterm.partial_redirect_disposition.partial_redirect_disposition..partial_redirect_disposition..partial_redirect_disposition] +Constructor that specifies the variable used to capture disposition values. + + + partial_redirect_disposition( + Disposition & d); + + + +[endsect] + + + [endsect] [section:partial_redirect_error partial_redirect_error] @@ -144114,9 +147705,9 @@ Synchronous `read_some` and `write_some` operations are thread safe with respect Submits a completion token or function object for execution. template< - typename ``[link boost_asio.reference.NullaryToken NullaryToken]``> + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = deferred_t> auto ``[link boost_asio.reference.post.overload1 post]``( - NullaryToken && token); + NullaryToken && token = deferred_t()); `` [''''»''' [link boost_asio.reference.post.overload1 more...]]`` template< @@ -144137,6 +147728,62 @@ Submits a completion token or function object for execution. constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); `` [''''»''' [link boost_asio.reference.post.overload3 more...]]`` +Submits a function to be run on a specified target executor, and after completion submits the completion handler. + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link boost_asio.reference.post.overload4 post]``( + Function && function, + const Executor & ex, + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + `` [''''»''' [link boost_asio.reference.post.overload4 more...]]`` + +Submits a function to be run on a specified target executor, and passes the result to a completion handler. + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename CompletionToken = default_completion_token_t> + auto ``[link boost_asio.reference.post.overload5 post]``( + Function && function, + const Executor & ex, + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + `` [''''»''' [link boost_asio.reference.post.overload5 more...]]`` + +Submits a function to be run on a specified execution context, and after completion submits the completion handler. + + template< + typename Function, + typename ExecutionContext, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto ``[link boost_asio.reference.post.overload6 post]``( + Function && function, + ExecutionContext & ctx, + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + `` [''''»''' [link boost_asio.reference.post.overload6 more...]]`` + +Submits a function to be run on a specified execution context, and passes the result to a completion handler. + + template< + typename Function, + typename ExecutionContext, + typename CompletionToken = default_completion_token_t> + auto ``[link boost_asio.reference.post.overload7 post]``( + Function && function, + ExecutionContext & ctx, + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + `` [''''»''' [link boost_asio.reference.post.overload7 more...]]`` + [heading Requirements] ['Header: ][^boost/asio/post.hpp] @@ -144144,16 +147791,16 @@ Submits a completion token or function object for execution. ['Convenience header: ][^boost/asio.hpp] -[section:overload1 post (1 of 3 overloads)] +[section:overload1 post (1 of 7 overloads)] Submits a completion token or function object for execution. template< - typename ``[link boost_asio.reference.NullaryToken NullaryToken]``> + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = deferred_t> auto post( - NullaryToken && token); + NullaryToken && token = deferred_t()); This function submits an object for execution using the object's associated executor. The function object is queued for execution, and is never called from the current thread prior to returning from `post()`. @@ -144196,7 +147843,7 @@ The function call operator of `Init:` * Obtains the handler's associated executor object `ex` of type `Ex` by performing - auto ex = get_associated_executor(handler); + auto ex = get_associated_executor(completion_handler); @@ -144204,7 +147851,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(completion_handler); @@ -144248,7 +147895,7 @@ The function call operator of `Init:` -[section:overload2 post (2 of 3 overloads)] +[section:overload2 post (2 of 7 overloads)] Submits a completion token or function object for execution. @@ -144310,7 +147957,7 @@ The function call operator of `Init:` * Obtains the handler's associated executor object `ex1` of type `Ex1` by performing - auto ex1 = get_associated_executor(handler, ex); + auto ex1 = get_associated_executor(completion_handler, ex); @@ -144318,7 +147965,7 @@ The function call operator of `Init:` * Obtains the handler's associated allocator object `alloc` by performing - auto alloc = get_associated_allocator(handler); + auto alloc = get_associated_allocator(completion_handler); @@ -144343,7 +147990,7 @@ The function call operator of `Init:` -* If `execution::is_executor::value` is true, performs +* If `execution::is_executor::value` is true, performs prefer( require(ex, execution::blocking.never), @@ -144355,7 +148002,7 @@ The function call operator of `Init:` -* If `execution::is_executor::value` is false, performs +* If `execution::is_executor::value` is false, performs ex.post(std::move(f), alloc); @@ -144379,7 +148026,7 @@ The function call operator of `Init:` -[section:overload3 post (3 of 3 overloads)] +[section:overload3 post (3 of 7 overloads)] Submits a completion token or function object for execution. @@ -144428,6 +148075,422 @@ Submits a completion token or function object for execution. +[endsect] + + + +[section:overload4 post (4 of 7 overloads)] + + +Submits a function to be run on a specified target executor, and after completion submits the completion handler. + + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto post( + Function && function, + const Executor & ex, + NullaryToken && token = default_completion_token_t< Executor >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + + +This function submits a function object for execution on the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `post()`. After the submitted function completes, the completion handler is dispatched to run on its associated executor. + +The use of `post()`, rather than [link boost_asio.reference.defer `defer`], indicates the caller's preference that the function object be eagerly queued for execution. + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ex][The target executor.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(); +`` +]] + +] + + +[heading Return Value] + +This function returns `async_initiate(Init{ex}, token, forward(function))`, where `Init` is a function object type defined as: + + + + class Init + { + public: + using executor_type = Executor; + explicit Init(const Executor& ex) : ex_(ex) {} + executor_type get_executor() const noexcept { return ex_; } + template + void operator()(CompletionHandler&& completion_handler, + Function&& function) const; + private: + Executor ex_; // exposition only + }; + + + + +The function call operator of `Init:` + + +* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing + + auto ex1 = get_associated_executor(completion_handler, ex); + + + + + +* Obtains the handler's associated allocator object `alloc` by performing + + auto alloc = get_associated_allocator(completion_handler); + + + + + +* If `execution::is_executor::value` is true, constructs a function object wrapper `f` with a member `executor_` that is initialised with `prefer(ex1, execution::outstanding_work.tracked)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + std::move(function_)(); + auto a = get_associated_allocator(handler_); + prefer(executor_, execution::allocator(a)).execute(std::move(handler_)); + + + + + +* If `execution::is_executor::value` is false, constructs a function object wrapper `f` with a member `work_` that is initialised with `make_work_guard(ex1)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + std::move(function_)(); + auto a = get_associated_allocator(handler_); + work_.get_executor().dispatch(std::move(handler_), a); + work_.reset(); + + + + + +* If `execution::is_executor::value` is true, performs + + prefer( + require(ex, execution::blocking.never), + execution::relationship.fork, + execution::allocator(alloc) + ).execute(std::move(f)); + + + + + +* If `execution::is_executor::value` is false, performs + + ex.post(std::move(f), alloc); + + + + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void() + + + + + + + +[endsect] + + + +[section:overload5 post (5 of 7 overloads)] + + +Submits a function to be run on a specified target executor, and passes the result to a completion handler. + + + template< + typename Function, + typename ``[link boost_asio.reference.Executor1 Executor]``, + typename CompletionToken = default_completion_token_t> + auto post( + Function && function, + const Executor & ex, + CompletionToken && token = default_completion_token_t< Executor >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t<(execution::is_executor< Executor >::value &&can_require< Executor, execution::blocking_t::never_t >::value)||is_executor< Executor >::value > = 0); + + +This function submits a function object for execution on the specified executor. The function object is queued for execution, and is never called from the current thread prior to returning from `post()`. After the submitted function completes, the completion handler is dispatched along with the function's result, to run on its associated executor. + +The use of `post()`, rather than [link boost_asio.reference.defer `defer`], indicates the caller's preference that the function object be eagerly queued for execution. + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ex][The target executor.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(decay_t()>>); +`` +]] + +] + + +[heading Return Value] + +This function returns `async_initiate(Init{ex}, token)`, where `Init` is a function object type defined as: + + + + class Init + { + public: + using executor_type = Executor; + explicit Init(const Executor& ex) : ex_(ex) {} + executor_type get_executor() const noexcept { return ex_; } + template + void operator()(CompletionHandler&& completion_handler, + Function&& function) const; + private: + Executor ex_; // exposition only + }; + + + + +The function call operator of `Init:` + + +* Obtains the handler's associated executor object `ex1` of type `Ex1` by performing + + auto ex1 = get_associated_executor(completion_handler, ex); + + + + + +* Obtains the handler's associated allocator object `alloc` by performing + + auto alloc = get_associated_allocator(completion_handler); + + + + + +* If `execution::is_executor::value` is true, constructs a function object wrapper `f` with a member `executor_` that is initialised with `prefer(ex1, execution::outstanding_work.tracked)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + auto result = std::move(function_)(); + auto a = get_associated_allocator(handler_); + prefer(executor_, execution::allocator(a)).execute( + std::bind(std::move(handler_), std::move(result))); + + + + + +* If `execution::is_executor::value` is false, constructs a function object wrapper `f` with a member `work_` that is initialised with `make_work_guard(ex1)`, a member `function_` that is a decay-copy of `function`, a member `handler_` that is a decay-copy of `completion_handler`, and a function call operator that performs: + + auto result = std::move(function_)(); + auto a = get_associated_allocator(handler_); + work_.get_executor().dispatch( + std::bind(std::move(handler_), std::move(result)), a); + work_.reset(); + + + + + +* If `execution::is_executor::value` is true, performs + + prefer( + require(ex, execution::blocking.never), + execution::relationship.fork, + execution::allocator(alloc) + ).execute(std::move(f)); + + + + + +* If `execution::is_executor::value` is false, performs + + ex.post(std::move(f), alloc); + + + + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void(decay_t()>>) + + + + + + + +[endsect] + + + +[section:overload6 post (6 of 7 overloads)] + + +Submits a function to be run on a specified execution context, and after completion submits the completion handler. + + + template< + typename Function, + typename ExecutionContext, + typename ``[link boost_asio.reference.NullaryToken NullaryToken]`` = default_completion_token_t> + auto post( + Function && function, + ExecutionContext & ctx, + NullaryToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ctx][An execution context, from which the target executor is obtained.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(); +`` +]] + +] + + +[heading Return Value] + +`post(forward(function), ctx.get_executor(), forward(token))`. + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void() + + + + + + + +[endsect] + + + +[section:overload7 post (7 of 7 overloads)] + + +Submits a function to be run on a specified execution context, and passes the result to a completion handler. + + + template< + typename Function, + typename ExecutionContext, + typename CompletionToken = default_completion_token_t> + auto post( + Function && function, + ExecutionContext & ctx, + CompletionToken && token = default_completion_token_t< typename ExecutionContext::executor_type >(), + constraint_t< !is_void< result_of_t< decay_t< Function >()> >::value > = 0, + constraint_t< is_convertible< ExecutionContext &, execution_context & >::value > = 0); + + + +[heading Parameters] + + +[variablelist + +[[function][A nullary function to be executed on the target executor.]] + +[[ctx][An execution context, from which the target executor is obtained.]] + +[[token][The [link boost_asio.overview.model.completion_tokens completion token] that will be used to produce a completion handler. The function signature of the completion handler must be: +`` + void handler(); +`` +]] + +] + + +[heading Return Value] + +`post(forward(function), ctx.get_executor(), forward(token))`. + + +[heading Remarks] + +If the function object throws an exception, that exception is allowed to propagate to the target executor. The behaviour in this case is dependent on the executor. For example, [link boost_asio.reference.io_context `io_context`] will allow the exception to propagate to the caller that runs the `io_context`, whereas [link boost_asio.reference.thread_pool `thread_pool`] will call `std::terminate`. + + +[heading Completion Signature] + + + + void(decay_t()>>) + + + + + + + [endsect] @@ -149558,7 +153621,7 @@ An allocator that caches memory blocks in thread-local storage for reuse. ] -The @recycling\_allocator uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. +The `recycling_allocator` uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. [heading Requirements] @@ -149798,7 +153861,7 @@ The rebound `allocator` type. ] -The @recycling\_allocator uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. +The `recycling_allocator` uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. [heading Requirements] @@ -149869,7 +153932,7 @@ A proto-allocator that caches memory blocks in thread-local storage for reuse. ] -The @recycling\_allocator uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. +The `recycling_allocator` uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. [heading Requirements] @@ -150077,7 +154140,7 @@ The rebound `allocator` type. ] -The @recycling\_allocator uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. +The `recycling_allocator` uses a simple strategy where a limited number of small memory blocks are cached in thread-local storage, if the current thread is running an `io_context` or is part of a `thread_pool`. [heading Requirements] @@ -150091,6 +154154,180 @@ The @recycling\_allocator uses a simple strategy where a limited number of small +[endsect] + +[section:redirect_disposition redirect_disposition] + +[indexterm1 boost_asio.indexterm.redirect_disposition..redirect_disposition] + +Create a partial completion token adapter that captures disposition values to a variable. + + template< + typename ``[link boost_asio.reference.Disposition Disposition]``> + partial_redirect_disposition< Disposition > ``[link boost_asio.reference.redirect_disposition.overload1 redirect_disposition]``( + Disposition & d); + `` [''''»''' [link boost_asio.reference.redirect_disposition.overload1 more...]]`` + +Adapt a [link boost_asio.overview.model.completion_tokens completion token] to capture disposition values to a variable. + + template< + typename CompletionToken, + typename ``[link boost_asio.reference.Disposition Disposition]``> + redirect_disposition_t< decay_t< CompletionToken >, Disposition > ``[link boost_asio.reference.redirect_disposition.overload2 redirect_disposition]``( + CompletionToken && completion_token, + Disposition & d); + `` [''''»''' [link boost_asio.reference.redirect_disposition.overload2 more...]]`` + +[heading Requirements] + +['Header: ][^boost/asio/redirect_disposition.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:overload1 redirect_disposition (1 of 2 overloads)] + + +Create a partial completion token adapter that captures disposition values to a variable. + + + template< + typename ``[link boost_asio.reference.Disposition Disposition]``> + partial_redirect_disposition< Disposition > redirect_disposition( + Disposition & d); + + + +[heading Remarks] + +When redirecting to a variable of type `std::exception_ptr`, other disposition types will be automatically converted to `std::exception_ptr`. + + + + +[endsect] + + + +[section:overload2 redirect_disposition (2 of 2 overloads)] + + +Adapt a [link boost_asio.overview.model.completion_tokens completion token] to capture disposition values to a variable. + + + template< + typename CompletionToken, + typename ``[link boost_asio.reference.Disposition Disposition]``> + redirect_disposition_t< decay_t< CompletionToken >, Disposition > redirect_disposition( + CompletionToken && completion_token, + Disposition & d); + + + +[heading Remarks] + +When redirecting to a variable of type `std::exception_ptr`, other disposition types will be automatically converted to `std::exception_ptr`. + + + + +[endsect] + + +[endsect] + +[section:redirect_disposition_t redirect_disposition_t] + +[indexterm1 boost_asio.indexterm.redirect_disposition_t..redirect_disposition_t] + + +A [link boost_asio.overview.model.completion_tokens completion token] adapter used to specify that the disposition produced by an asynchronous operation is captured to a variable. + + + template< + typename CompletionToken, + typename ``[link boost_asio.reference.Disposition Disposition]``> + class redirect_disposition_t + + +[heading Member Functions] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.redirect_disposition_t.redirect_disposition_t [*redirect_disposition_t]] [constructor]] + [Constructor. ] + ] + +] + +[heading Data Members] +[table + [[Name][Description]] + + [ + [[link boost_asio.reference.redirect_disposition_t.d_ [*d_]]] + [] + ] + + [ + [[link boost_asio.reference.redirect_disposition_t.token_ [*token_]]] + [] + ] + +] + +The [link boost_asio.reference.redirect_disposition_t `redirect_disposition_t`] class is used to indicate that any disposition produced by an asynchronous operation is captured to a specified variable. + +[heading Requirements] + +['Header: ][^boost/asio/redirect_disposition.hpp] + +['Convenience header: ][^boost/asio.hpp] + + +[section:d_ redirect_disposition_t::d_] + +[indexterm2 boost_asio.indexterm.redirect_disposition_t.d_..d_..redirect_disposition_t] + + Disposition & d_; + + + +[endsect] + + + +[section:redirect_disposition_t redirect_disposition_t::redirect_disposition_t] + +[indexterm2 boost_asio.indexterm.redirect_disposition_t.redirect_disposition_t..redirect_disposition_t..redirect_disposition_t] +Constructor. + + + template< + typename T> + redirect_disposition_t( + T && completion_token, + Disposition & d); + + + +[endsect] + + + +[section:token_ redirect_disposition_t::token_] + +[indexterm2 boost_asio.indexterm.redirect_disposition_t.token_..token_..redirect_disposition_t] + + CompletionToken token_; + + + +[endsect] + + + [endsect] [section:redirect_error redirect_error] @@ -160278,7 +164515,7 @@ Request the strand to invoke the given function object. const Allocator & a) const; -This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled by the underlying executor's defer function. +This function is used to ask the executor to execute the given function object. The function object will never be executed inside this function. Instead, it will be scheduled by the underlying executor's post function. [heading Parameters] @@ -161167,6 +165404,8 @@ The executor type associated with the context. [ [[link boost_asio.reference.basic_system_executor.query__static [*query]] [static]] [Query the current value of the mapping property. + [hr] + Query the current value of the inline_exception_handling property. [hr] Query the current value of the context property. [hr] @@ -161494,6 +165733,8 @@ An executor that uses arbitrary threads. [ [[link boost_asio.reference.basic_system_executor.query__static [*query]] [static]] [Query the current value of the mapping property. + [hr] + Query the current value of the inline_exception_handling property. [hr] Query the current value of the context property. [hr] @@ -162484,6 +166725,8 @@ Executor used to submit functions to a thread pool. [ [[link boost_asio.reference.thread_pool__basic_executor_type.query__static [*query]] [static]] [Query the current value of the mapping property. + [hr] + Query the current value of the inline_exception_handling property. [hr] Query the current value of the outstanding_work property. ] ] @@ -163074,6 +167317,8 @@ Executor implementation type used to submit functions to a thread pool. [ [[link boost_asio.reference.thread_pool__basic_executor_type.query__static [*query]] [static]] [Query the current value of the mapping property. + [hr] + Query the current value of the inline_exception_handling property. [hr] Query the current value of the outstanding_work property. ] ] @@ -163684,15 +167929,23 @@ Query the current value of the `mapping` property. `` [''''»''' [link boost_asio.reference.thread_pool__basic_executor_type.query__static.overload1 more...]]`` -Query the current value of the `outstanding_work` property. +Query the current value of the `inline_exception_handling` property. - static constexpr execution::outstanding_work_t ``[link boost_asio.reference.thread_pool__basic_executor_type.query__static.overload2 query]``( - execution::outstanding_work_t ); + static constexpr execution::inline_exception_handling_t ``[link boost_asio.reference.thread_pool__basic_executor_type.query__static.overload2 query]``( + execution::inline_exception_handling_t ); `` [''''»''' [link boost_asio.reference.thread_pool__basic_executor_type.query__static.overload2 more...]]`` -[section:overload1 thread_pool::basic_executor_type::query (1 of 2 overloads)] +Query the current value of the `outstanding_work` property. + + + static constexpr execution::outstanding_work_t ``[link boost_asio.reference.thread_pool__basic_executor_type.query__static.overload3 query]``( + execution::outstanding_work_t ); + `` [''''»''' [link boost_asio.reference.thread_pool__basic_executor_type.query__static.overload3 more...]]`` + + +[section:overload1 thread_pool::basic_executor_type::query (1 of 3 overloads)] Query the current value of the `mapping` property. @@ -163719,7 +167972,35 @@ For example: -[section:overload2 thread_pool::basic_executor_type::query (2 of 2 overloads)] +[section:overload2 thread_pool::basic_executor_type::query (2 of 3 overloads)] + + +Query the current value of the `inline_exception_handling` property. + + + static constexpr execution::inline_exception_handling_t query( + execution::inline_exception_handling_t ); + + +Do not call this function directly. It is intended for use with the [link boost_asio.reference.query `query`] customisation point. + +For example: + + auto ex = my_thread_pool.get_executor(); + if (boost::asio::query(ex, + boost::asio::execution::inline_exception_handling) + == boost::asio::execution::inline_exception_handling.terminate) + ... + + + + + +[endsect] + + + +[section:overload3 thread_pool::basic_executor_type::query (3 of 3 overloads)] Query the current value of the `outstanding_work` property.