Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

make_work_guard (5 of 5 overloads)

Create an executor_work_guard object.

template<
    typename T,
    typename ExecutionContext>
executor_work_guard< associated_executor_t< T, typename ExecutionContext::executor_type > > make_work_guard(
    const T & t,
    ExecutionContext & ctx,
    constraint_t< !is_executor< T >::value >  = 0,
    constraint_t< !execution::is_executor< T >::value >  = 0,
    constraint_t< !is_convertible< T &, execution_context & >::value >  = 0,
    constraint_t< is_convertible< ExecutionContext &, execution_context & >::value >  = 0);
Parameters

t

An arbitrary object, such as a completion handler, for which the associated executor will be obtained.

ctx

An execution context, from which an executor is obtained to use as the candidate object for determining the associated executor.

Return Value

A work guard constructed with the associated executor of the object t, which is obtained as if by calling get_associated_executor(t, ctx.get_executor()).


PrevUpHomeNext