Change iteration order to avoid temporary map

This commit is contained in:
2025-09-01 16:52:40 -04:00
parent 953ec3ad43
commit 31e751fe75
2 changed files with 174 additions and 192 deletions

View File

@@ -9,6 +9,7 @@
#include <iostream>
#include <limits>
#include <new>
#include <span>
#include <type_traits>
#include <typeinfo>
#include <utility>
@@ -639,6 +640,12 @@ template <typename T> struct ArenaVector {
void clear() { size_ = 0; }
// Implicit conversion to std::span
operator std::span<T>() { return std::span<T>(data_, size_); }
operator std::span<const T>() const {
return std::span<const T>(data_, size_);
}
// Iterator support for range-based for loops
T *begin() { return data_; }
const T *begin() const { return data_; }