summaryrefslogtreecommitdiff
path: root/src/util/AllocatedArray.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-09-21 20:34:36 +0200
committerMax Kellermann <max@musicpd.org>2017-09-21 20:34:36 +0200
commite5c9b4cd75f3202215da8fe9ee437525e8e8d278 (patch)
tree525ea68f5122730ba3cc44f599f258f4f3799b5b /src/util/AllocatedArray.hxx
parent8753e558f24e177a355722f27463d9742b2bbd66 (diff)
util/{Const,Writable}Buffer: add operator==(nullptr_t)
Diffstat (limited to 'src/util/AllocatedArray.hxx')
-rw-r--r--src/util/AllocatedArray.hxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/AllocatedArray.hxx b/src/util/AllocatedArray.hxx
index 1a726a323..3b14eb114 100644
--- a/src/util/AllocatedArray.hxx
+++ b/src/util/AllocatedArray.hxx
@@ -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.
*/