From bd4df1ae5deb6a01b31cc4a2cc971f29a80302d8 Mon Sep 17 00:00:00 2001
From: Max Kellermann <mk@cm4all.com>
Date: Mon, 9 Dec 2019 09:47:37 +0100
Subject: [PATCH] util/AllocatedArray: add WritableBuffer/ConstBuffer cast
 operators

---
 src/util/AllocatedArray.hxx | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/util/AllocatedArray.hxx b/src/util/AllocatedArray.hxx
index fc6400014..ead3a49b3 100644
--- a/src/util/AllocatedArray.hxx
+++ b/src/util/AllocatedArray.hxx
@@ -106,6 +106,14 @@ public:
 		return *this;
 	}
 
+	operator ConstBuffer<T>() const noexcept {
+		return buffer;
+	}
+
+	operator WritableBuffer<T>() noexcept {
+		return buffer;
+	}
+
 	constexpr bool IsNull() const noexcept {
 		return buffer.IsNull();
 	}