Array#

Source file#

ChaiGO container/sequence/array

Interface#

template<ContainerElement T, size_t N>
struct Array#

A array container.

An array is an aggregate that can be list-initialized with up to N elements whose types are convertible to T. An array meets all of the requirements of a container and of a reversible container, except that a default constructed array object is not empty if N > 0. An array meets some of the requirements of a sequence container.

模板参数
  • T – Type of element. Required to be a complete type.

  • N – Number of elements.

Public Types

using value_type = T#
using pointer = value_type*#
using const_pointer = const value_type*#
using reference = value_type&#
using const_reference = const value_type&#
using size_type = size_t#
using difference_type = ptrdiff_t#
using iterator = value_type*#
using const_iterator = const value_type*#
using reverse_iterator = std::reverse_iterator<iterator>#
using const_reverse_iterator = std::reverse_iterator<const_iterator>#
using ArrayTraitsType = ArrayTraits<T, N>#

Public Functions

constexpr void fill(const T &value)#
constexpr void swap(Array&) noexcept(std::is_nothrow_swappable_v<T>)#
constexpr iterator begin() noexcept#
constexpr const_iterator begin() const noexcept#
constexpr iterator end() noexcept#
constexpr const_iterator end() const noexcept#
constexpr reverse_iterator rbegin() noexcept#
constexpr const_reverse_iterator rbegin() const noexcept#
constexpr reverse_iterator rend() noexcept#
constexpr const_reverse_iterator rend() const noexcept#
constexpr const_iterator cbegin() const noexcept#
constexpr const_iterator cend() const noexcept#
constexpr const_reverse_iterator crbegin() const noexcept#
constexpr const_reverse_iterator crend() const noexcept#
constexpr bool empty() const noexcept#
constexpr size_type size() const noexcept#
constexpr size_type max_size() const noexcept#
constexpr reference operator[](size_type n)#
constexpr const_reference operator[](size_type n) const#
constexpr reference at(size_type n)#
constexpr const_reference at(size_type n) const#
constexpr reference front()#
constexpr const_reference front() const#
constexpr reference back()#
constexpr const_reference back() const#
constexpr pointer data() noexcept#
constexpr const_pointer data() const noexcept#

Public Members

ArrayTraitsType::type elems_#