80 data_ = inline_buffer_;
91 requires(std::is_convertible_v<U, T>)
95 data_ = this->get_buffer_for_size(
size);
105 requires(std::is_convertible_v<U, T>)
126 data_ = this->get_buffer_for_size(
size);
140 data_ = this->get_buffer_for_size(
size,
true);
143 data_ = this->get_buffer_for_size(
size);
144#if defined(__GNUC__) && !defined(__clang__)
145# pragma GCC diagnostic push
146# pragma GCC diagnostic ignored "-Warray-bounds"
149#if defined(__GNUC__) && !defined(__clang__)
150# pragma GCC diagnostic pop
172 data_ = this->get_buffer_for_size(
size);
178 Array(
Array &&other)
noexcept(std::is_nothrow_move_constructible_v<T>)
181 if (other.data_ == other.inline_buffer_) {
182#if defined(__GNUC__) && !defined(__clang__)
183# pragma GCC diagnostic push
184# pragma GCC diagnostic ignored
"-Warray-bounds"
186 uninitialized_relocate_n(other.data_, other.size_, data_);
187#if defined(__GNUC__) && !defined(__clang__)
188# pragma GCC diagnostic pop
196 other.data_ = other.inline_buffer_;
203 this->deallocate_if_not_inline(data_);
311 return *(data_ + size_ - 1 - n);
317 return *(data_ + size_ - 1 - n);
338 return data_ + size_;
347 return data_ + size_;
352 return std::reverse_iterator<T *>(this->
end());
354 std::reverse_iterator<T *>
rend()
356 return std::reverse_iterator<T *>(this->
begin());
359 std::reverse_iterator<const T *>
rbegin()
const
361 return std::reverse_iterator<T *>(this->
end());
363 std::reverse_iterator<const T *>
rend()
const
365 return std::reverse_iterator<T *>(this->
begin());
383 return values.
hash();
423 return InlineBufferCapacity;
438 if (new_size <= old_size) {
442 T *new_data = this->get_buffer_for_size(new_size,
false);
447 this->deallocate_if_not_inline(new_data);
450 this->deallocate_if_not_inline(data_);
458 T *get_buffer_for_size(
int64_t size,
const bool zero =
false)
460 if (
size <= InlineBufferCapacity) {
462 if constexpr (InlineBufferCapacity > 0) {
463 memset(
static_cast<void *
>(inline_buffer_), 0,
size *
sizeof(
T));
466 return inline_buffer_;
468 return this->allocate(
size, zero);
474 return static_cast<T *
>(allocator_.allocate_zero(
size_t(
size) *
sizeof(
T),
alignof(
T),
AT));
476 return static_cast<T *
>(allocator_.allocate(
size_t(
size) *
sizeof(
T),
alignof(
T),
AT));
479 void deallocate_if_not_inline(
T *ptr)
481 if (ptr != inline_buffer_) {
482 allocator_.deallocate(ptr);
#define BLI_NO_UNIQUE_ADDRESS
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Array(Array &&other) noexcept(std::is_nothrow_move_constructible_v< T >)
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
Array(const std::initializer_list< U > &values, Allocator allocator={})
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)
const T & const_reference
Array(Span< U > values, Allocator allocator={})
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 IndexRange()=default
constexpr MutableSpan()=default
constexpr const T * data() const
constexpr int64_t size() const
constexpr uint64_t hash() const
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
unsigned __int64 uint64_t
void default_construct_n(T *ptr, int64_t n)
constexpr bool value_is_zero_memory(const VecBase< T, Size > &v)
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)
constexpr bool is_span_convertible_pointer_v