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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

make_work_guard (4 of 5 overloads)

Create an executor_work_guard object.

    typename T,
    typename Executor>
executor_work_guard< typename associated_executor< T, Executor >::type > make_work_guard(
    const T & t,
    const Executor & ex,
    typename constraint< is_executor< Executor >::value||execution::is_executor< Executor >::value >::type  = 0);


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


An executor to be used as the candidate object when 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, ex).