From 2cc1dd28cdd185956646bae25b48b0e96f7824d8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 9 Dec 2019 09:40:18 +0100 Subject: [PATCH] util/AllocatedArray: add capacity() For STL completeness. --- src/util/AllocatedArray.hxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/util/AllocatedArray.hxx b/src/util/AllocatedArray.hxx index 86ac833ff..c37a3f992 100644 --- a/src/util/AllocatedArray.hxx +++ b/src/util/AllocatedArray.hxx @@ -121,6 +121,13 @@ public: return buffer.size; } + /** + * Returns the number of allocated elements. + */ + constexpr size_type capacity() const noexcept { + return buffer.size; + } + reference_type front() noexcept { return buffer.front(); }