80 data_ = inline_buffer_;
89 template<
typename U, BLI_ENABLE_IF((std::is_convertible_v<U, T>))>
93 data_ = this->get_buffer_for_size(
size);
101 template<
typename U, BLI_ENABLE_IF((std::is_convertible_v<U, T>))>
122 data_ = this->get_buffer_for_size(
size);
135 data_ = this->get_buffer_for_size(
size);
136#if defined(__GNUC__) && !defined(__clang__)
137# pragma GCC diagnostic push
138# pragma GCC diagnostic ignored "-Warray-bounds"
141#if defined(__GNUC__) && !defined(__clang__)
142# pragma GCC diagnostic pop
163 data_ = this->get_buffer_for_size(
size);
169 Array(
Array &&other)
noexcept(std::is_nothrow_move_constructible_v<T>)
172 if (other.data_ == other.inline_buffer_) {
173#if defined(__GNUC__) && !defined(__clang__)
174# pragma GCC diagnostic push
175# pragma GCC diagnostic ignored
"-Warray-bounds"
177 uninitialized_relocate_n(other.data_, other.size_, data_);
178#if defined(__GNUC__) && !defined(__clang__)
179# pragma GCC diagnostic pop
187 other.data_ = other.inline_buffer_;
194 this->deallocate_if_not_inline(data_);
231 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<T, U>))>
237 template<
typename U, BLI_ENABLE_IF((is_span_convertible_po
inter_v<T, U>))>
300 return *(data_ + size_ - 1 - n);
306 return *(data_ + size_ - 1 - n);
327 return data_ + size_;
336 return data_ + size_;
341 return std::reverse_iterator<T *>(this->
end());
343 std::reverse_iterator<T *>
rend()
345 return std::reverse_iterator<T *>(this->
begin());
348 std::reverse_iterator<const T *>
rbegin()
const
350 return std::reverse_iterator<T *>(this->
end());
352 std::reverse_iterator<const T *>
rend()
const
354 return std::reverse_iterator<T *>(this->
begin());
372 return values.
hash();
412 return InlineBufferCapacity;
427 if (new_size <= old_size) {
431 T *new_data = this->get_buffer_for_size(new_size);
436 this->deallocate_if_not_inline(new_data);
439 this->deallocate_if_not_inline(data_);
449 if (
size <= InlineBufferCapacity) {
450 return inline_buffer_;
452 return this->allocate(
size);
457 return static_cast<T *
>(allocator_.allocate(
size_t(
size) *
sizeof(
T),
alignof(
T),
AT));
460 void deallocate_if_not_inline(
T *
ptr)
462 if (
ptr != inline_buffer_) {
463 allocator_.deallocate(
ptr);
#define BLI_NO_UNIQUE_ADDRESS
unsigned long long int uint64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Array(Allocator allocator={}) noexcept
Array(Array &&other) noexcept(std::is_nothrow_move_constructible_v< T >)
Array(Span< U > values, Allocator allocator={})
Array(NoExceptConstructor, Allocator allocator={}) noexcept
std::reverse_iterator< T * > rbegin()
Span< Slot > as_span() const
MutableSpan< T > as_mutable_span()
friend bool operator!=(const Array &a, const Array &b)
const T & operator[](int64_t index) const
const T & last(const int64_t n=0) const
Array(Allocator allocator={}) noexcept
static int64_t inline_buffer_capacity()
T & operator[](int64_t index)
Array(int64_t size, const T &value, Allocator allocator={})
std::reverse_iterator< T * > rend()
static uint64_t hash_as(const Span< T > values)
IndexRange index_range() const
const Allocator & allocator() const
std::reverse_iterator< const T * > rend() const
T & last(const int64_t n=0)
std::reverse_iterator< const T * > rbegin() const
Array(int64_t size, NoInitialization, Allocator allocator={})
void fill(const T &value) const
friend bool operator==(const Array &a, const Array &b)
Array(const std::initializer_list< U > &values, Allocator allocator={})
const T & const_reference
void reinitialize(const int64_t new_size)
Array & operator=(const Array &other)
void clear_without_destruct()
Array(int64_t size, Allocator allocator={})
Array & operator=(Array &&other) noexcept(std::is_nothrow_move_constructible_v< T >)
Array(const Array &other)
Array(const std::initializer_list< T > &values, Allocator allocator={})
constexpr const T * data() const
constexpr int64_t size() const
constexpr uint64_t hash() const
void default_construct_n(T *ptr, int64_t n)
void initialized_fill_n(T *dst, int64_t n, const T &value)
Container & copy_assign_container(Container &dst, const Container &src)
Container & move_assign_container(Container &dst, Container &&src) noexcept(std::is_nothrow_move_constructible_v< Container >)
constexpr int64_t default_inline_buffer_capacity(size_t element_size)
void uninitialized_fill_n(T *dst, int64_t n, const T &value)
void uninitialized_convert_n(const From *src, int64_t n, To *dst)
void destruct_n(T *ptr, int64_t n)