Skip to content

Commit 97de7f7

Browse files
committed
Thread/Accessors: operator*
1 parent f2fc516 commit 97de7f7

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

modules/Thread/SharedLocker.mpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export namespace CppUtils::Thread
2828
return std::addressof(self.value());
2929
}
3030

31+
[[nodiscard]] inline auto operator*(this auto&& self) noexcept -> decltype(auto)
32+
{
33+
return self.value();
34+
}
35+
3136
[[nodiscard]] inline auto getLockGuard() const& noexcept -> auto&
3237
{
3338
return m_lockGuard;

modules/Thread/UniqueLocker.mpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export namespace CppUtils::Thread
2727
return std::addressof(self.value());
2828
}
2929

30+
[[nodiscard]] inline auto operator*(this auto&& self) noexcept -> decltype(auto)
31+
{
32+
return self.value();
33+
}
34+
3035
[[nodiscard]] inline auto getLockGuard() & noexcept -> auto&
3136
{
3237
return m_lockGuard;
@@ -60,6 +65,11 @@ export namespace CppUtils::Thread
6065
return std::addressof(self.value());
6166
}
6267

68+
[[nodiscard]] inline auto operator*(this auto&& self) noexcept -> decltype(auto)
69+
{
70+
return self.value();
71+
}
72+
6373
[[nodiscard]] inline auto getLockGuard() & noexcept -> auto&
6474
{
6575
return m_lockGuard;

0 commit comments

Comments
 (0)