diff options
Diffstat (limited to 'asl/types/box.hpp')
-rw-r--r-- | asl/types/box.hpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/asl/types/box.hpp b/asl/types/box.hpp index 6501e3e..bb4e620 100644 --- a/asl/types/box.hpp +++ b/asl/types/box.hpp @@ -76,18 +76,21 @@ public: } } - constexpr T* get() const { return m_ptr; } + constexpr auto* get(this auto&& self) + { + return self.m_ptr; + } - constexpr T& operator*() const + constexpr auto&& operator*(this auto&& self) { - ASL_ASSERT(m_ptr != nullptr); - return *m_ptr; + ASL_ASSERT(self.m_ptr != nullptr); + return std::forward_like<decltype(self)&&>(*self.m_ptr); } - constexpr T* operator->() const + constexpr auto* operator->(this auto&& self) { - ASL_ASSERT(m_ptr != nullptr); - return m_ptr; + ASL_ASSERT(self.m_ptr != nullptr); + return self.m_ptr; } constexpr bool operator==(niche_t) const |