diff options
Diffstat (limited to 'libs/kstd')
| -rw-r--r-- | libs/kstd/kstd/bits/concepts.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/kstd/kstd/bits/concepts.hpp b/libs/kstd/kstd/bits/concepts.hpp index 3e89caa9..af9f6d2c 100644 --- a/libs/kstd/kstd/bits/concepts.hpp +++ b/libs/kstd/kstd/bits/concepts.hpp @@ -11,9 +11,21 @@ namespace kstd::bits concept container_compatible_range = std::ranges::input_range<RangeType> && std::convertible_to<std::ranges::range_reference_t<RangeType>, ValueType>; + //! Requirements on a basic lockable object. + //! + //! Given: + //! - @p L, a class type + //! - @p l, an instance of @p L + //! + //! @p L is said to be **lockable**, iff. the following expressions are valid: + //! - @p l.lock(); + //! - @p l.unlock(); template<typename LockableType> concept basic_lockable = requires(LockableType & lockable) { + //! Lock the lockable object, blocking until the lock has been acquired. lockable.lock(); + + //! Unlock the lockable object. lockable.unlock(); }; |
