Change iteration order to avoid temporary map
This commit is contained in:
@@ -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_; }
|
||||
|
||||
Reference in New Issue
Block a user