mirror of
https://github.com/hyprwm/hyprutils.git
synced 2025-01-27 17:39:49 +01:00
memory/weak: add missing nullptr comparison operators (#41)
This commit is contained in:
parent
3411e5b42d
commit
fb0c2d1de3
1 changed files with 8 additions and 0 deletions
|
@ -153,6 +153,14 @@ namespace Hyprutils {
|
|||
return impl_ == rhs.impl_;
|
||||
}
|
||||
|
||||
bool operator==(std::nullptr_t) const {
|
||||
return !valid();
|
||||
}
|
||||
|
||||
bool operator!=(std::nullptr_t) const {
|
||||
return valid();
|
||||
}
|
||||
|
||||
bool operator()(const CWeakPointer& lhs, const CWeakPointer& rhs) const {
|
||||
return reinterpret_cast<uintptr_t>(lhs.impl_) < reinterpret_cast<uintptr_t>(rhs.impl_);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue