From 332ba42073b4cd11c951d55b5bd9783fd12a752b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 29 Jul 2024 22:18:03 +0200 Subject: [PATCH] util/HugeAllocator: add std::span cast operator --- src/util/HugeAllocator.hxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/HugeAllocator.hxx b/src/util/HugeAllocator.hxx index 7ffd07c6f..69d7e7af0 100644 --- a/src/util/HugeAllocator.hxx +++ b/src/util/HugeAllocator.hxx @@ -181,6 +181,14 @@ public: return buffer != nullptr; } + constexpr operator std::span() noexcept { + return buffer; + } + + constexpr operator std::span() noexcept { + return buffer; + } + /** * Returns the number of allocated elements. */