diff options
author | Max Kellermann <mk@cm4all.com> | 2019-12-09 09:47:37 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-12-17 20:18:54 +0100 |
commit | bd4df1ae5deb6a01b31cc4a2cc971f29a80302d8 (patch) | |
tree | 074d974547c0876355ebb116456c4b025d224f67 | |
parent | a93b7172aab170566a7ef7d6f44657f08859dcca (diff) |
util/AllocatedArray: add WritableBuffer/ConstBuffer cast operators
-rw-r--r-- | src/util/AllocatedArray.hxx | 8 |
1 files changed, 8 insertions, 0 deletions
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(); } |