From c44a7b2705b061f8d8c24ef24b7e1555d5610db7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 14 Jan 2021 16:12:07 +0100 Subject: [PATCH] util/AllocatedArray: add operator=(nullptr) --- src/util/AllocatedArray.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/AllocatedArray.hxx b/src/util/AllocatedArray.hxx index c920d9f06..9a2b08690 100644 --- a/src/util/AllocatedArray.hxx +++ b/src/util/AllocatedArray.hxx @@ -110,6 +110,12 @@ public: return *this; } + AllocatedArray &operator=(std::nullptr_t n) noexcept { + delete[] buffer.data; + buffer = n; + return *this; + } + operator ConstBuffer() const noexcept { return buffer; }