util/{Const,Writable}Buffer: add operator==(nullptr_t)

This commit is contained in:
Max Kellermann
2017-09-21 20:34:36 +02:00
parent 8753e558f2
commit e5c9b4cd75
3 changed files with 40 additions and 0 deletions

View File

@@ -100,6 +100,14 @@ public:
return buffer.IsNull();
}
constexpr bool operator==(std::nullptr_t) const {
return buffer == nullptr;
}
constexpr bool operator!=(std::nullptr_t) const {
return buffer != nullptr;
}
/**
* Returns true if no memory was allocated so far.
*/