Fixes optional pointers.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-12-12 11:37:19 +01:00
parent f704a6c2f7
commit 9f064c1e25
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 7 additions and 1 deletions

View File

@ -43,7 +43,7 @@ namespace ArbUt {
}
/// @brief Return whether the pointer is null or not.
[[nodiscard]] inline bool HasValue() const noexcept { return _raw == nullptr; }
[[nodiscard]] inline bool HasValue() const noexcept { return _raw != nullptr; }
/// @brief Get the raw underlying pointer.
inline T* GetValue() const noexcept { return _raw; }

View File

@ -33,6 +33,12 @@ namespace ArbUt {
return *this;
}
/// @brief Return whether the pointer is null or not.
[[nodiscard]] inline bool HasValue() const noexcept { return _raw != nullptr; }
/// @brief Get the raw underlying pointer.
inline T* GetValue() const noexcept { return _raw; }
/// @brief Assign operator with raw pointer.
inline OptionalUniquePtr<T>& operator=(T* rhs) {
if (_raw == rhs) {