Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions stl/inc/mutex
Original file line number Diff line number Diff line change
Expand Up @@ -139,33 +139,33 @@ public:

unique_lock() noexcept = default;

_NODISCARD_CTOR_LOCK explicit unique_lock(_Mutex& _Mtx)
_NODISCARD_LOCK explicit unique_lock(_Mutex& _Mtx)
: _Pmtx(_STD addressof(_Mtx)), _Owns(false) { // construct and lock
_Pmtx->lock();
_Owns = true;
}

_NODISCARD_CTOR_LOCK unique_lock(_Mutex& _Mtx, adopt_lock_t) noexcept // strengthened
_NODISCARD_LOCK unique_lock(_Mutex& _Mtx, adopt_lock_t) noexcept // strengthened
: _Pmtx(_STD addressof(_Mtx)), _Owns(true) {} // construct and assume already locked

unique_lock(_Mutex& _Mtx, defer_lock_t) noexcept
: _Pmtx(_STD addressof(_Mtx)), _Owns(false) {} // construct but don't lock

_NODISCARD_CTOR_LOCK unique_lock(_Mutex& _Mtx, try_to_lock_t)
_NODISCARD_LOCK unique_lock(_Mutex& _Mtx, try_to_lock_t)
: _Pmtx(_STD addressof(_Mtx)), _Owns(_Pmtx->try_lock()) {} // construct and try to lock

template <class _Rep, class _Period>
_NODISCARD_CTOR_LOCK unique_lock(_Mutex& _Mtx, const chrono::duration<_Rep, _Period>& _Rel_time)
_NODISCARD_LOCK unique_lock(_Mutex& _Mtx, const chrono::duration<_Rep, _Period>& _Rel_time)
: _Pmtx(_STD addressof(_Mtx)), _Owns(_Pmtx->try_lock_for(_Rel_time)) {} // construct and lock with timeout

template <class _Clock, class _Duration>
_NODISCARD_CTOR_LOCK unique_lock(_Mutex& _Mtx, const chrono::time_point<_Clock, _Duration>& _Abs_time)
_NODISCARD_LOCK unique_lock(_Mutex& _Mtx, const chrono::time_point<_Clock, _Duration>& _Abs_time)
: _Pmtx(_STD addressof(_Mtx)), _Owns(_Pmtx->try_lock_until(_Abs_time)) {
// construct and lock with timeout
static_assert(chrono::_Is_clock_v<_Clock>, "Clock type required");
}

_NODISCARD_CTOR_LOCK unique_lock(unique_lock&& _Other) noexcept : _Pmtx(_Other._Pmtx), _Owns(_Other._Owns) {
_NODISCARD_LOCK unique_lock(unique_lock&& _Other) noexcept : _Pmtx(_Other._Pmtx), _Owns(_Other._Owns) {
_Other._Pmtx = nullptr;
_Other._Owns = false;
}
Expand Down
6 changes: 3 additions & 3 deletions stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ namespace ranges {
requires default_initializable<_Ty>
= default;

_NODISCARD_CTOR constexpr explicit repeat_view(const _Ty& _Value_, _Bo _Bound_ = _Bo{})
_NODISCARD constexpr explicit repeat_view(const _Ty& _Value_, _Bo _Bound_ = _Bo{})
noexcept(is_nothrow_copy_constructible_v<_Ty>) // strengthened
requires copy_constructible<_Ty>
: _Value(in_place, _Value_), _Bound(_STD move(_Bound_)) {
Expand All @@ -1269,7 +1269,7 @@ namespace ranges {
}
#endif // _ITERATOR_DEBUG_LEVEL != 0
}
_NODISCARD_CTOR constexpr explicit repeat_view(_Ty&& _Value_, _Bo _Bound_ = _Bo{})
_NODISCARD constexpr explicit repeat_view(_Ty&& _Value_, _Bo _Bound_ = _Bo{})
noexcept(is_nothrow_move_constructible_v<_Ty>) // strengthened
: _Value(in_place, _STD move(_Value_)), _Bound(_STD move(_Bound_)) {
#if _ITERATOR_DEBUG_LEVEL != 0
Expand All @@ -1280,7 +1280,7 @@ namespace ranges {
}
template <class... _TArgs, class... _BArgs>
requires constructible_from<_Ty, _TArgs...> && constructible_from<_Bo, _BArgs...>
_NODISCARD_CTOR constexpr explicit repeat_view(
_NODISCARD constexpr explicit repeat_view(
piecewise_construct_t, tuple<_TArgs...> _Val_args, tuple<_BArgs...> _Bound_args = tuple<>{})
noexcept(noexcept(_RANGES _Make_box_from_tuple<_Ty>(_STD move(_Val_args)))
&& noexcept(_STD make_from_tuple<_Bo>(_STD move(_Bound_args)))) // strengthened
Expand Down
12 changes: 6 additions & 6 deletions stl/inc/shared_mutex
Original file line number Diff line number Diff line change
Expand Up @@ -212,28 +212,28 @@ public:

shared_lock() noexcept = default;

_NODISCARD_CTOR_LOCK explicit shared_lock(mutex_type& _Mtx)
_NODISCARD_LOCK explicit shared_lock(mutex_type& _Mtx)
: _Pmtx(_STD addressof(_Mtx)), _Owns(true) { // construct with mutex and lock shared
_Mtx.lock_shared();
}

shared_lock(mutex_type& _Mtx, defer_lock_t) noexcept
: _Pmtx(_STD addressof(_Mtx)), _Owns(false) {} // construct with unlocked mutex

_NODISCARD_CTOR_LOCK shared_lock(mutex_type& _Mtx, try_to_lock_t)
_NODISCARD_LOCK shared_lock(mutex_type& _Mtx, try_to_lock_t)
: _Pmtx(_STD addressof(_Mtx)), _Owns(_Mtx.try_lock_shared()) {} // construct with mutex and try to lock shared

_NODISCARD_CTOR_LOCK shared_lock(mutex_type& _Mtx, adopt_lock_t) noexcept // strengthened
_NODISCARD_LOCK shared_lock(mutex_type& _Mtx, adopt_lock_t) noexcept // strengthened
: _Pmtx(_STD addressof(_Mtx)), _Owns(true) {} // construct with mutex and adopt ownership

template <class _Rep, class _Period>
_NODISCARD_CTOR_LOCK shared_lock(mutex_type& _Mtx, const chrono::duration<_Rep, _Period>& _Rel_time)
_NODISCARD_LOCK shared_lock(mutex_type& _Mtx, const chrono::duration<_Rep, _Period>& _Rel_time)
: _Pmtx(_STD addressof(_Mtx)), _Owns(_Mtx.try_lock_shared_for(_Rel_time)) {
// construct with mutex and try to lock for relative time
}

template <class _Clock, class _Duration>
_NODISCARD_CTOR_LOCK shared_lock(mutex_type& _Mtx, const chrono::time_point<_Clock, _Duration>& _Abs_time)
_NODISCARD_LOCK shared_lock(mutex_type& _Mtx, const chrono::time_point<_Clock, _Duration>& _Abs_time)
: _Pmtx(_STD addressof(_Mtx)), _Owns(_Mtx.try_lock_shared_until(_Abs_time)) {
// construct with mutex and try to lock until absolute time
static_assert(chrono::_Is_clock_v<_Clock>, "Clock type required");
Expand All @@ -245,7 +245,7 @@ public:
}
}

_NODISCARD_CTOR_LOCK shared_lock(shared_lock&& _Other) noexcept : _Pmtx(_Other._Pmtx), _Owns(_Other._Owns) {
_NODISCARD_LOCK shared_lock(shared_lock&& _Other) noexcept : _Pmtx(_Other._Pmtx), _Owns(_Other._Owns) {
_Other._Pmtx = nullptr;
_Other._Owns = false;
}
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/source_location
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ _EXPORT_STD struct source_location {
return _Result;
}

_NODISCARD_CTOR constexpr source_location() noexcept = default;
_NODISCARD constexpr source_location() noexcept = default;

_NODISCARD constexpr uint_least32_t line() const noexcept {
return _Line;
Expand Down
Loading