mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Add equality operators to maybe_nul_ret
This commit is contained in:
parent
35fb11853f
commit
1a791992a0
@ -267,6 +267,9 @@ public:
|
|||||||
maybe_null_ret& operator=(const T& p) { if (ptr_ != p) { ptr_ = p; } return *this; }
|
maybe_null_ret& operator=(const T& p) { if (ptr_ != p) { ptr_ = p; } return *this; }
|
||||||
maybe_null_ret& operator=(const maybe_null_ret& rhs) = default;
|
maybe_null_ret& operator=(const maybe_null_ret& rhs) = default;
|
||||||
|
|
||||||
|
bool operator==(const T& rhs) const { return ptr_ == rhs; }
|
||||||
|
bool operator!=(const T& rhs) const { return ptr_ != rhs; }
|
||||||
|
|
||||||
bool present() const { return ptr_ != nullptr; }
|
bool present() const { return ptr_ != nullptr; }
|
||||||
|
|
||||||
T get() const { return ptr_; }
|
T get() const { return ptr_; }
|
||||||
|
Loading…
Reference in New Issue
Block a user