diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h index 893a8d7330..00dcfac28b 100644 --- a/core/templates/local_vector.h +++ b/core/templates/local_vector.h @@ -48,13 +48,12 @@ private: T *data = nullptr; public: - T *ptr() { - return data; - } + _FORCE_INLINE_ T *ptr() { return data; } + _FORCE_INLINE_ const T *ptr() const { return data; } + _FORCE_INLINE_ U size() const { return count; } - const T *ptr() const { - return data; - } + _FORCE_INLINE_ Span span() const { return Span(data, count); } + _FORCE_INLINE_ operator Span() const { return span(); } // Must take a copy instead of a reference (see GH-31736). _FORCE_INLINE_ void push_back(T p_elem) { @@ -146,7 +145,6 @@ public: } } - _FORCE_INLINE_ U size() const { return count; } void resize(U p_size) { if (p_size < count) { if constexpr (!std::is_trivially_destructible_v && !force_trivial) {