File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,14 +13,16 @@ export namespace CppUtils::Thread
1313 m_value{std::ref(value)}
1414 {}
1515
16- [[nodiscard]] inline auto value() & noexcept -> T&
16+ template<class Self>
17+ [[nodiscard]] inline auto value(this Self& self) noexcept -> decltype(auto)
1718 {
18- return m_value.get();
19+ return self. m_value.get();
1920 }
2021
21- [[nodiscard]] inline auto operator->() & noexcept -> T*
22+ template<class Self>
23+ [[nodiscard]] inline auto operator->(this Self& self) noexcept -> decltype(auto)
2224 {
23- return std::addressof(value());
25+ return std::addressof(self. value());
2426 }
2527
2628 [[nodiscard]] inline auto getLockGuard() & noexcept -> auto&
@@ -42,14 +44,16 @@ export namespace CppUtils::Thread
4244 m_value{std::cref(value)}
4345 {}
4446
45- [[nodiscard]] inline auto value() & noexcept -> const T&
47+ template<class Self>
48+ [[nodiscard]] inline auto value(this Self& self) noexcept -> decltype(auto)
4649 {
47- return m_value.get();
50+ return self. m_value.get();
4851 }
4952
50- [[nodiscard]] inline auto operator->() & noexcept -> const T*
53+ template<class Self>
54+ [[nodiscard]] inline auto operator->(this Self& self) noexcept -> decltype(auto)
5155 {
52- return std::addressof(value());
56+ return std::addressof(self. value());
5357 }
5458
5559 [[nodiscard]] inline auto getLockGuard() & noexcept -> auto&
You can’t perform that action at this time.
0 commit comments