From 4af522f61e30ff7ba819bab9e7846fd9d81342ef Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Fri, 20 Dec 2024 09:12:11 +0200 Subject: [PATCH] utils: small_vector: expose internal_capacity() So we can use it for defining other small_vector deriving their internal capacity from another small_vector type. Signed-off-by: Benny Halevy --- utils/small_vector.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/small_vector.hh b/utils/small_vector.hh index 8ac37ffc5d..86245781d9 100644 --- a/utils/small_vector.hh +++ b/utils/small_vector.hh @@ -251,6 +251,10 @@ public: } } + static constexpr size_t internal_capacity() noexcept { + return N; + } + size_t external_memory_usage() const { if (uses_internal_storage()) { return 0;