diff options
author | Max Kellermann <max@musicpd.org> | 2017-09-21 20:34:36 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-09-21 20:34:36 +0200 |
commit | e5c9b4cd75f3202215da8fe9ee437525e8e8d278 (patch) | |
tree | 525ea68f5122730ba3cc44f599f258f4f3799b5b /src/util/WritableBuffer.hxx | |
parent | 8753e558f24e177a355722f27463d9742b2bbd66 (diff) |
util/{Const,Writable}Buffer: add operator==(nullptr_t)
Diffstat (limited to 'src/util/WritableBuffer.hxx')
-rw-r--r-- | src/util/WritableBuffer.hxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/WritableBuffer.hxx b/src/util/WritableBuffer.hxx index 8272b012d..3155d5503 100644 --- a/src/util/WritableBuffer.hxx +++ b/src/util/WritableBuffer.hxx @@ -68,6 +68,14 @@ struct WritableBuffer<void> { return data == nullptr; } + constexpr bool operator==(std::nullptr_t) const { + return data == nullptr; + } + + constexpr bool operator!=(std::nullptr_t) const { + return data != nullptr; + } + constexpr bool IsEmpty() const { return size == 0; } @@ -137,6 +145,14 @@ struct WritableBuffer { return data == nullptr; } + constexpr bool operator==(std::nullptr_t) const { + return data == nullptr; + } + + constexpr bool operator!=(std::nullptr_t) const { + return data != nullptr; + } + constexpr bool IsEmpty() const { return size == 0; } |