Fixes inequality with raw pointer with smart pointers being inverted.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-12-12 12:10:37 +01:00
parent 7ec2a3f2b0
commit 362e4bf59b
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
5 changed files with 5 additions and 5 deletions

View File

@ -60,7 +60,7 @@ namespace ArbUt {
/// @brief Check equality of two BorrowedPtr objects
inline bool operator!=(const BorrowedPtr<T>& 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 T> Const() const noexcept { return BorrowedPtr<const T>(_raw); }

View File

@ -55,7 +55,7 @@ namespace ArbUt {
/// @brief Check equality of two BorrowedPtr objects
inline bool operator!=(const OptionalBorrowedPtr<T>& 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 T> Const() const noexcept { return BorrowedPtr<const T>(_raw); }

View File

@ -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; }

View File

@ -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; }
};
}

View File

@ -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; }
};
}