Delete comparison with nullptr for non-null pointers.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
90bb8d54b6
commit
0e49c58647
|
@ -57,10 +57,14 @@ namespace ArbUt {
|
||||||
inline bool operator==(const BorrowedPtr<T>& rhs) const noexcept { return _raw == rhs._raw; }
|
inline bool operator==(const BorrowedPtr<T>& rhs) const noexcept { return _raw == rhs._raw; }
|
||||||
/// @brief Check equality of pointers
|
/// @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 Delete comparison with nullptr, BorrowedPtr can't be null
|
||||||
|
inline bool operator==(std::nullptr_t) const = delete;
|
||||||
/// @brief Check equality of two BorrowedPtr objects
|
/// @brief Check equality of two BorrowedPtr objects
|
||||||
inline bool operator!=(const BorrowedPtr<T>& rhs) const noexcept { return _raw != rhs._raw; }
|
inline bool operator!=(const BorrowedPtr<T>& rhs) const noexcept { return _raw != rhs._raw; }
|
||||||
/// @brief Check equality of pointers
|
/// @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 Delete comparison with nullptr, BorrowedPtr can't be null
|
||||||
|
inline bool operator!=(std::nullptr_t) const = delete;
|
||||||
|
|
||||||
/// @brief Returns a const version of the underlying pointer.
|
/// @brief Returns a const version of the underlying pointer.
|
||||||
inline BorrowedPtr<const T> Const() const noexcept { return BorrowedPtr<const T>(_raw); }
|
inline BorrowedPtr<const T> Const() const noexcept { return BorrowedPtr<const T>(_raw); }
|
||||||
|
|
|
@ -61,10 +61,14 @@ namespace ArbUt {
|
||||||
inline bool operator==(const UniquePtr& rhs) const noexcept { return _raw == rhs._raw; }
|
inline bool operator==(const UniquePtr& rhs) const noexcept { return _raw == rhs._raw; }
|
||||||
/// @brief Check equality of pointers
|
/// @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 Delete comparison with nullptr, UniquePtr can't be null
|
||||||
|
inline bool operator==(std::nullptr_t) const = delete;
|
||||||
/// @brief Check equality of two UniquePtr objects
|
/// @brief Check equality of two UniquePtr objects
|
||||||
inline bool operator!=(const UniquePtr& rhs) const noexcept { return _raw != rhs._raw; }
|
inline bool operator!=(const UniquePtr& rhs) const noexcept { return _raw != rhs._raw; }
|
||||||
/// @brief Check equality of pointers
|
/// @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 Delete comparison with nullptr, UniquePtr can't be null
|
||||||
|
inline bool operator!=(std::nullptr_t) const = delete;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue