util/HugeAllocator: add std::span cast operator

This commit is contained in:
Max Kellermann 2024-07-29 22:18:03 +02:00
parent 4262d29965
commit 332ba42073
1 changed files with 8 additions and 0 deletions

View File

@ -181,6 +181,14 @@ public:
return buffer != nullptr;
}
constexpr operator std::span<T>() noexcept {
return buffer;
}
constexpr operator std::span<const T>() noexcept {
return buffer;
}
/**
* Returns the number of allocated elements.
*/