We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb0111a commit e343d3fCopy full SHA for e343d3f
1 file changed
include/oryx/crt/synchronized.hpp
@@ -49,6 +49,13 @@ class Synchronized {
49
explicit Synchronized(Args &&...args)
50
: guarded_data_{std::forward<Args>(args)...} {}
51
52
+ operator value_type() const noexcept
53
+ requires(std::is_copy_constructible_v<value_type>)
54
+ {
55
+ std::lock_guard lock{mutex_};
56
+ return guarded_data_;
57
+ }
58
+
59
auto WriteLock() { return UpdateGuard{*this}; }
60
61
auto ReadLock() const { return UpdateGuard<const value_type, MutexType>{*this}; }
0 commit comments