memory/weak: add missing nullptr comparison operators (#41)

This commit is contained in:
nyx 2025-01-24 08:31:48 -05:00 committed by GitHub
parent 3411e5b42d
commit fb0c2d1de3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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_);
}