diff --git a/src/mc/deps/core/common/bedrock/NonOwnerPointer.h b/src/mc/deps/core/common/bedrock/NonOwnerPointer.h index e273bf2a98..656001b34b 100644 --- a/src/mc/deps/core/common/bedrock/NonOwnerPointer.h +++ b/src/mc/deps/core/common/bedrock/NonOwnerPointer.h @@ -11,11 +11,11 @@ class NonOwnerPointer { std::shared_ptr mControlBlock; NonOwnerPointer(std::nullptr_t) noexcept {} // NOLINT T* get() const { return reinterpret_cast(mControlBlock.get()); } - explicit operator bool() const noexcept { return get() != nullptr; } + explicit operator bool() const noexcept { return mControlBlock; } - [[nodiscard]] constexpr operator T*() const { return get(); } - [[nodiscard]] constexpr T* operator->() const { return get(); } - [[nodiscard]] constexpr decltype(auto) operator*() const { return *get(); } + [[nodiscard]] constexpr operator T*() const { return get(); } + [[nodiscard]] constexpr T* operator->() const { return get(); } + [[nodiscard]] constexpr T& operator*() const { return *get(); } }; template @@ -35,5 +35,4 @@ template [[nodiscard]] std::strong_ordering operator<=>(NonOwnerPointer const& l, NonOwnerPointer const& r) noexcept { return l.get() <=> r.get(); } - }; // namespace Bedrock