|
stlab 2.3.0
Modern, modular C++ algorithms, data structures, and concurrency primitives
|
Bind an object’s lifetime to a callable’s execution (scope). More...
#include <stlab/config.hpp>#include <mutex>#include <tuple>#include <utility>Go to the source code of this file.
Functions | |
| template<typename T, typename... Args> | |
| auto | stlab::scope (Args &&... args) |
| Scopes the lifetime of an instance of T. All but the last arguments construct T; the last argument is a nullary function invoked while T is alive. T is destroyed after that function returns. | |
| template<typename T, typename F> | |
| auto | stlab::scope (std::mutex &m, F &&f) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Bind an object’s lifetime to a callable’s execution (scope).