13 template <
class T,
class Lock = std::mutex,
template<
class>
class Guard = std::lock_guard>
25 template <
class... Args>
26 explicit Mutexed(Args&&... args) : value{std::forward<Args>(args)...} {
39 std::forward<F>(f)(static_cast<value_type&>(this->value));
49 return mutex.transaction(std::forward<F&&>(delegate));
std::unique_lock< lock_type > lock
A wrapper class that protects a value with a lock.
Global namespace of the SCL.
Mutexed & transaction(F &&f)
constexpr scl::utils::Placeholder _
Mutexed & operator=(Mutexed &&) noexcept=default
auto operator()(Mutexed< T > &mutex, F &&delegate) -> scl::tools::meta ::return_t< F >
Guard< lock_type > guard_type
Traits for use with the scl::async::with function.