Fixes assignment of raw pointers to smart pointers being broken.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
1119012158
commit
5ef9d5f6fc
|
@ -28,15 +28,17 @@ namespace ArbUt {
|
|||
|
||||
/// @brief Copy operator.
|
||||
inline BorrowedPtr<T>& operator=(const BorrowedPtr<T>& rhs) {
|
||||
if (this == &rhs)
|
||||
if (this == &rhs) {
|
||||
return *this;
|
||||
}
|
||||
_raw = rhs._raw;
|
||||
return *this;
|
||||
}
|
||||
/// @brief Assign operator with raw pointer.
|
||||
inline BorrowedPtr<T>& operator=(T* rhs) {
|
||||
if (_raw == &rhs)
|
||||
if (_raw == rhs) {
|
||||
return *this;
|
||||
}
|
||||
AssertNotNull(rhs);
|
||||
_raw = rhs;
|
||||
return *this;
|
||||
|
|
|
@ -27,15 +27,17 @@ namespace ArbUt {
|
|||
|
||||
/// @brief Copy operator.
|
||||
inline OptionalBorrowedPtr<T>& operator=(const OptionalBorrowedPtr<T>& rhs) {
|
||||
if (this == &rhs)
|
||||
if (this == &rhs) {
|
||||
return *this;
|
||||
}
|
||||
_raw = rhs._raw;
|
||||
return *this;
|
||||
}
|
||||
/// @brief Assign operator with raw pointer.
|
||||
inline OptionalBorrowedPtr<T>& operator=(T* rhs) {
|
||||
if (_raw == &rhs)
|
||||
if (_raw == rhs) {
|
||||
return *this;
|
||||
}
|
||||
_raw = rhs;
|
||||
return *this;
|
||||
}
|
||||
|
|
|
@ -26,16 +26,18 @@ namespace ArbUt {
|
|||
|
||||
/// @brief Copy operator.
|
||||
inline OptionalUniquePtr<T>& operator=(const OptionalUniquePtr<T>& rhs) {
|
||||
if (this == &rhs)
|
||||
if (this == &rhs) {
|
||||
return *this;
|
||||
}
|
||||
_raw = rhs._raw;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// @brief Assign operator with raw pointer.
|
||||
inline OptionalUniquePtr<T>& operator=(T* rhs) {
|
||||
if (_raw == &rhs)
|
||||
if (_raw == rhs) {
|
||||
return *this;
|
||||
}
|
||||
_raw = rhs;
|
||||
return *this;
|
||||
}
|
||||
|
|
|
@ -24,16 +24,18 @@ namespace ArbUt {
|
|||
|
||||
/// @brief Copy operator.
|
||||
inline ScopedPtr<T>& operator=(const ScopedPtr<T>& rhs) {
|
||||
if (this == &rhs)
|
||||
if (this == &rhs) {
|
||||
return *this;
|
||||
}
|
||||
_raw = rhs._raw;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// @brief Assign operator with raw pointer.
|
||||
inline ScopedPtr<T>& operator=(T* rhs) {
|
||||
if (_raw == &rhs)
|
||||
if (_raw == rhs) {
|
||||
return *this;
|
||||
}
|
||||
_raw = rhs;
|
||||
return *this;
|
||||
}
|
||||
|
|
|
@ -28,8 +28,9 @@ namespace ArbUt {
|
|||
|
||||
/// @brief Copy operator.
|
||||
inline UniquePtr<T>& operator=(const UniquePtr<T>& rhs) {
|
||||
if (this == &rhs)
|
||||
if (this == &rhs) {
|
||||
return *this;
|
||||
}
|
||||
delete _raw;
|
||||
_raw = rhs._raw;
|
||||
return *this;
|
||||
|
@ -37,7 +38,7 @@ namespace ArbUt {
|
|||
|
||||
/// @brief Assign operator with raw pointer.
|
||||
inline UniquePtr<T>& operator=(T* rhs) {
|
||||
if (_raw == &rhs) {
|
||||
if (_raw == rhs) {
|
||||
return *this;
|
||||
}
|
||||
delete _raw;
|
||||
|
|
Loading…
Reference in New Issue