|
constexpr auto | back () const noexcept -> const_reference |
| Accesses the last item.
|
|
constexpr auto | back () noexcept -> reference |
| Accesses the last item.
|
|
constexpr auto | begin () const noexcept -> const_iterator |
| Returns an iterator to the beginning.
|
|
constexpr auto | begin () noexcept -> iterator |
| Returns an iterator to the beginning.
|
|
constexpr auto | cbegin () const noexcept -> const_iterator |
| Returns an const iterator to the beginning.
|
|
constexpr auto | cend () const noexcept -> const_iterator |
| Returns an const iterator to the end.
|
|
constexpr auto | crbegin () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the first element of the reversed array. It corresponds to the last element of the non-reversed array. If the array is empty, the returned iterator is equal to rend().
|
|
constexpr auto | crend () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the element following the last element of the reversed array. It corresponds to the element preceding the first element of the non-reversed array. This element acts as a placeholder, attempting to access it results in undefined behavior.
|
|
constexpr auto | data () const noexcept -> const_pointer |
| Returns pointer to the underlying array serving as element storage. The pointer is such that range [data(); data() + size()) is always a valid range, even if the container is empty (data() is not dereferenceable in that case).
|
|
constexpr auto | data () noexcept -> pointer |
| Returns pointer to the underlying array serving as element storage. The pointer is such that range [data(); data() + size()) is always a valid range, even if the container is empty (data() is not dereferenceable in that case).
|
|
constexpr auto | empty () const noexcept -> bool |
| Checks if the container has no elements, i.e. whether begin() == end().
|
|
constexpr auto | end () const noexcept -> const_iterator |
| Returns an iterator to the end.
|
|
constexpr auto | end () noexcept -> iterator |
| Returns an iterator to the end.
|
|
constexpr auto | fill (const_reference value) -> void |
| Assigns the given value value to all elements in the container.
|
|
constexpr auto | front () const noexcept -> const_reference |
| Accesses the first item.
|
|
constexpr auto | front () noexcept -> reference |
| Accesses the first item.
|
|
constexpr auto | max_size () const noexcept -> size_type |
| Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. distance(begin(), end()) for the largest container.
|
|
constexpr auto | operator[] (size_type const pos) const noexcept -> const_reference |
| Accesses the specified item with range checking.
|
|
constexpr auto | operator[] (size_type const pos) noexcept -> reference |
| Accesses the specified item with range checking.
|
|
constexpr auto | rbegin () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the first element of the reversed array. It corresponds to the last element of the non-reversed array. If the array is empty, the returned iterator is equal to rend().
|
|
constexpr auto | rbegin () noexcept -> reverse_iterator |
| Returns a reverse iterator to the first element of the reversed array. It corresponds to the last element of the non-reversed array. If the array is empty, the returned iterator is equal to rend().
|
|
constexpr auto | rend () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the element following the last element of the reversed array. It corresponds to the element preceding the first element of the non-reversed array. This element acts as a placeholder, attempting to access it results in undefined behavior.
|
|
constexpr auto | rend () noexcept -> reverse_iterator |
| Returns a reverse iterator to the element following the last element of the reversed array. It corresponds to the element preceding the first element of the non-reversed array. This element acts as a placeholder, attempting to access it results in undefined behavior.
|
|
constexpr auto | size () const noexcept -> size_type |
| Returns the number of elements in the container, i.e. distance(begin(), end()).
|
|
constexpr auto | swap (array &other) noexcept(is_nothrow_swappable_v< Type >) -> void |
| Exchanges the contents of the container with those of other. Does not cause iterators and references to associate with the other container.
|
|
|
constexpr auto | operator< (array const &lhs, array const &rhs) -> bool |
| Compares the contents of lhs and rhs lexicographically. The comparison is performed by a function equivalent to lexicographical_compare.
|
|
constexpr auto | operator<= (array const &lhs, array const &rhs) -> bool |
|
constexpr auto | operator== (array const &lhs, array const &rhs) -> bool |
| Checks if the contents of lhs and rhs are equal, that is, they have the same number of elements and each element in lhs compares equal with the element in rhs at the same position.
|
|
constexpr auto | operator> (array const &lhs, array const &rhs) -> bool |
|
constexpr auto | operator>= (array const &lhs, array const &rhs) -> bool |
|
constexpr auto | swap (array &lhs, array &rhs) noexcept(noexcept(lhs.swap(rhs))) -> void |
| Specializes the swap algorithm for array. Swaps the contents of lhs and rhs.
|
|
|
(Note that these are not member symbols.)
|
template<typename T, typename... U> |
| array (T, U...) -> array< T, 1+sizeof...(U)> |
| One deduction guide is provided for array to provide an equivalent of experimental::make_array for construction of array from a variadic parameter pack. The program is ill-formed if (is_same_v<T, U> and ...) is not true. Note that it is true when sizeof...(U) is zero.
|
|
template<size_t Index, typename T, size_t Size> |
constexpr auto | get (array< T, Size > &&array) noexcept -> T && |
|
template<size_t Index, typename T, size_t Size> |
constexpr auto | get (array< T, Size > &array) noexcept -> T & |
| Extracts the Ith element element from the array. I must be an integer value in range [0, N). This is enforced at compile time as opposed to at() or operator[].
|
|
template<size_t Index, typename T, size_t Size> |
constexpr auto | get (array< T, Size > const &&array) noexcept -> T const && |
|
template<size_t Index, typename T, size_t Size> |
constexpr auto | get (array< T, Size > const &array) noexcept -> T const & |
|
template<typename T, etl::size_t Size> |
constexpr auto | is_tuple_like< etl::array< T, Size > > = true |
|
template<typename T, size_t N> |
constexpr auto | to_array (T(&&a)[N]) |
|
template<typename T, size_t N> |
constexpr auto | to_array (T(&a)[N]) -> array< remove_cv_t< T >, N > |
| Creates a array from the one dimensional built-in array a. The elements of the array are copy-initialized from the corresponding element of a. Copying or moving multidimensional built-in array is not supported.
|
|
template<typename Type,
size_t Size>
struct etl::array< Type, Size >
A container that encapsulates fixed size arrays.
This container is an aggregate type with the same semantics as a struct holding a C-style array Type[N] as its only non-static data member. Unlike a C-style array, it doesn't decay to Type* automatically. As an aggregate type, it can be initialized with aggregate-initialization given at most N initializers that are convertible to Type: array<int, 3> a = {1,2,3};
#undef NDEBUG
auto main() -> int
{
decltype(src) dest = {};
etl::copy(src.begin(), src.end(), dest.begin());
return 0;
}
#define assert(...)
Definition cassert.hpp:19
constexpr auto all_of(InputIt first, InputIt last, Predicate p) -> bool
Checks if unary predicate p returns true for all elements in the range [first, last).
Definition all_of.hpp:15
constexpr auto copy(InputIt first, InputIt last, OutputIt destination) -> OutputIt
Copies the elements in the range, defined by [first, last), to another range beginning at destination...
Definition copy.hpp:18
A container that encapsulates fixed size arrays.
Definition array.hpp:48
constexpr auto fill(const_reference value) -> void
Assigns the given value value to all elements in the container.
Definition array.hpp:207
- Examples
- array.cpp, numeric.cpp, and set.cpp.