92 data_ = inline_buffer_;
103 template<
typename U,
typename std::enable_if_t<std::is_convertible_v<U, T>> * =
nullptr>
108 uninitialized_convert_n<U, T>(values.
data(),
size, data_);
115 template<
typename U,
typename std::enable_if_t<std::is_convertible_v<U, T>> * =
nullptr>
178 Array(
Array &&other) noexcept(std::is_nothrow_move_constructible_v<T>)
181 if (other.data_ == other.inline_buffer_) {
189 other.data_ = other.inline_buffer_;
196 this->deallocate_if_not_inline(
data_);
233 template<
typename U,
typename std::enable_if_t<is_span_convertible_po
inter_v<T, U>> * =
nullptr>
239 template<
typename U,
typename std::enable_if_t<is_span_convertible_po
inter_v<T, U>> * =
nullptr>
286 return *(
data_ + size_ - 1);
291 return *(
data_ + size_ - 1);
312 return data_ + size_;
321 return data_ + size_;
326 return std::reverse_iterator<T *>(this->
end());
328 std::reverse_iterator<T *>
rend()
330 return std::reverse_iterator<T *>(this->
begin());
333 std::reverse_iterator<const T *>
rbegin()
const
335 return std::reverse_iterator<T *>(this->
end());
337 std::reverse_iterator<const T *>
rend()
const
339 return std::reverse_iterator<T *>(this->
begin());
377 return InlineBufferCapacity;
392 if (new_size <= old_size) {
396 T *new_data = this->get_buffer_for_size(new_size);
401 this->deallocate_if_not_inline(new_data);
404 this->deallocate_if_not_inline(
data_);
414 if (
size <= InlineBufferCapacity) {
415 return inline_buffer_;
418 return this->allocate(
size);
424 return static_cast<T *
>(
425 allocator_.allocate(
static_cast<size_t>(
size) *
sizeof(
T),
alignof(
T),
AT));
428 void deallocate_if_not_inline(
T *
ptr)
430 if (
ptr != inline_buffer_) {
431 allocator_.deallocate(
ptr);
440 template<
typename T,
int64_t InlineBufferCapacity = default_inline_buffer_capacity(sizeof(T))>
Array(Array &&other) noexcept(std::is_nothrow_move_constructible_v< T >)
Array(Span< U > values, Allocator allocator={})
Array(NoExceptConstructor, Allocator allocator={}) noexcept
Array & operator=(Array &&other) noexcept(std::is_nothrow_move_constructible_v< T >)
Array(Allocator allocator={}) noexcept
static int64_t inline_buffer_capacity()
std::reverse_iterator< const T * > rend() const
Array(int64_t size, const T &value, Allocator allocator={})
std::reverse_iterator< T * > rbegin()
const T & operator[](int64_t index) const
IndexRange index_range() const
Span< T > as_span() const
Array(int64_t size, NoInitialization, Allocator allocator={})
void fill(const T &value) const
std::reverse_iterator< const T * > rbegin() const
Array(const std::initializer_list< U > &values, Allocator allocator={})
const T & const_reference
void reinitialize(const int64_t new_size)
const Allocator & allocator() const
Array & operator=(const Array &other)
T & operator[](int64_t index)
void clear_without_destruct()
Array(int64_t size, Allocator allocator={})
Array(const Array &other)
std::reverse_iterator< T * > rend()
MutableSpan< T > as_mutable_span()
Array(const std::initializer_list< T > &values, Allocator allocator={})
constexpr const T * data() const
constexpr int64_t size() const
Container & move_assign_container(Container &dst, Container &&src) noexcept(std::is_nothrow_move_constructible_v< Container >)
void default_construct_n(T *ptr, int64_t n)
Container & copy_assign_container(Container &dst, const Container &src)
void initialized_fill_n(T *dst, int64_t n, const T &value)
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_relocate_n(T *src, int64_t n, T *dst)
void destruct_n(T *ptr, int64_t n)