From 362e4bf59b96c1387d7866231c86874b84c453bb Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 12 Dec 2020 12:10:37 +0100 Subject: [PATCH] Fixes inequality with raw pointer with smart pointers being inverted. --- src/Memory/__BorrowedPtr.hpp | 2 +- src/Memory/__OptionalBorrowedPtr.hpp | 2 +- src/Memory/__OptionalUniquePtr.hpp | 2 +- src/Memory/__ScopedPtr.hpp | 2 +- src/Memory/__UniquePtr.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Memory/__BorrowedPtr.hpp b/src/Memory/__BorrowedPtr.hpp index 9c03522..e4d08e8 100644 --- a/src/Memory/__BorrowedPtr.hpp +++ b/src/Memory/__BorrowedPtr.hpp @@ -60,7 +60,7 @@ namespace ArbUt { /// @brief Check equality of two BorrowedPtr objects inline bool operator!=(const BorrowedPtr& rhs) const noexcept { return _raw != rhs._raw; } /// @brief Check equality of pointers - inline bool operator!=(T* rhs) const noexcept { return _raw == rhs; } + inline bool operator!=(T* rhs) const noexcept { return _raw != rhs; } /// @brief Returns a const version of the underlying pointer. inline BorrowedPtr Const() const noexcept { return BorrowedPtr(_raw); } diff --git a/src/Memory/__OptionalBorrowedPtr.hpp b/src/Memory/__OptionalBorrowedPtr.hpp index c08fb60..511bee4 100644 --- a/src/Memory/__OptionalBorrowedPtr.hpp +++ b/src/Memory/__OptionalBorrowedPtr.hpp @@ -55,7 +55,7 @@ namespace ArbUt { /// @brief Check equality of two BorrowedPtr objects inline bool operator!=(const OptionalBorrowedPtr& rhs) const noexcept { return _raw != rhs._raw; } /// @brief Check equality of pointers - inline bool operator!=(T* rhs) const noexcept { return _raw == rhs; } + inline bool operator!=(T* rhs) const noexcept { return _raw != rhs; } /// @brief Returns a const version of the underlying pointer. inline OptionalBorrowedPtr Const() const noexcept { return BorrowedPtr(_raw); } diff --git a/src/Memory/__OptionalUniquePtr.hpp b/src/Memory/__OptionalUniquePtr.hpp index 18bcc5e..56e0412 100644 --- a/src/Memory/__OptionalUniquePtr.hpp +++ b/src/Memory/__OptionalUniquePtr.hpp @@ -62,7 +62,7 @@ namespace ArbUt { /// @brief Check equality of two OptionalUniquePtr objects inline bool operator!=(const OptionalUniquePtr& rhs) const noexcept { return _raw != rhs._raw; } /// @brief Check equality of pointers - inline bool operator!=(T* rhs) const noexcept { return _raw == rhs; } + inline bool operator!=(T* rhs) const noexcept { return _raw != rhs; } /// @brief Implicit cast to retrieve raw pointer. inline operator T*() const noexcept { return _raw; } diff --git a/src/Memory/__ScopedPtr.hpp b/src/Memory/__ScopedPtr.hpp index 4c3161b..b03defe 100644 --- a/src/Memory/__ScopedPtr.hpp +++ b/src/Memory/__ScopedPtr.hpp @@ -61,7 +61,7 @@ namespace ArbUt { /// @brief Check equality of two ScopedPtr objects inline bool operator!=(const ScopedPtr& rhs) const noexcept { return _raw != rhs._raw; } /// @brief Check equality of pointers - inline bool operator!=(T* rhs) const noexcept { return _raw == rhs; } + inline bool operator!=(T* rhs) const noexcept { return _raw != rhs; } }; } diff --git a/src/Memory/__UniquePtr.hpp b/src/Memory/__UniquePtr.hpp index 27f0b95..88e3e57 100644 --- a/src/Memory/__UniquePtr.hpp +++ b/src/Memory/__UniquePtr.hpp @@ -64,7 +64,7 @@ namespace ArbUt { /// @brief Check equality of two UniquePtr objects inline bool operator!=(const UniquePtr& rhs) const noexcept { return _raw != rhs._raw; } /// @brief Check equality of pointers - inline bool operator!=(T* rhs) const noexcept { return _raw == rhs; } + inline bool operator!=(T* rhs) const noexcept { return _raw != rhs; } }; }