java/Ref: add nullptr comparison

This commit is contained in:
Max Kellermann 2021-03-28 13:31:01 +02:00 committed by Max Kellermann
parent c33f206ce8
commit 95d5efbfe6

View File

@ -85,6 +85,14 @@ public:
return value != nullptr;
}
bool operator==(std::nullptr_t n) const noexcept {
return value == n;
}
bool operator!=(std::nullptr_t n) const noexcept {
return !(*this == n);
}
T Get() const noexcept {
return value;
}