1
0
Fork 0

Merge pull request #103936 from Ivorforce/localvector-span

Add `Span` conversion to `LocalVector`.
This commit is contained in:
Thaddeus Crews 2025-03-10 21:05:53 -05:00
commit b404c5d98f
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
1 changed files with 5 additions and 7 deletions

View File

@ -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<T> span() const { return Span(data, count); }
_FORCE_INLINE_ operator Span<T>() 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<T> && !force_trivial) {