31#ifndef ETL_ARRAY_INCLUDED
32#define ETL_ARRAY_INCLUDED
41#include "static_assert.h"
86 template <
typename T,
size_t SIZE_>
95 static ETL_CONSTANT
size_t SIZE =
SIZE_;
106 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
107 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
130#if defined(ETL_THROW_EXCEPTIONS)
271 ETL_CONSTEXPR const_iterator cend()
const ETL_NOEXCEPT
280 reverse_iterator rbegin() ETL_NOEXCEPT
282 return reverse_iterator(
end());
291 return const_reverse_iterator(
end());
300 return const_reverse_iterator(
end());
307 reverse_iterator
rend() ETL_NOEXCEPT
309 return reverse_iterator(
begin());
316 ETL_CONSTEXPR const_reverse_iterator
rend()
const ETL_NOEXCEPT
318 return const_reverse_iterator(
begin());
325 ETL_CONSTEXPR const_reverse_iterator
crend()
const ETL_NOEXCEPT
327 return const_reverse_iterator(
begin());
380 using ETL_OR_STD::swap;
382 for (
size_t i = 0
UL;
i < SIZE; ++
i)
394 template <
typename TIterator>
406 template <
typename TIterator>
413 etl::fill(p,
end(), value);
435 etl::move_backward(p,
end() - 1,
end());
447 template <
typename TIterator>
459 template <
typename TIterator>
472 etl::move_backward(p, p + length,
end());
499 etl::move(p + 1,
end(), p);
524 etl::move(last, cend(), p);
547 etl::move(p + 1,
end(), p);
573 p = etl::move(last, cend(), p);
574 etl::fill(p,
end(), value);
576 return to_iterator(first);
593 template <
typename T,
size_t SIZE_>
594 ETL_CONSTANT
size_t array<T, SIZE_>::SIZE;
600 template <
typename... T>
607#if ETL_HAS_INITIALIZER_LIST
608 template <
typename T,
typename... TValues>
609 constexpr auto make_array(TValues&&... values) ->
etl::array<T,
sizeof...(TValues)>
620 template <
typename T, const
size_t SIZE>
632 template <
typename T,
size_t SIZE>
635 return etl::equal(
lhs.cbegin(),
lhs.cend(),
rhs.cbegin());
644 template <
typename T,
size_t SIZE>
656 template <
typename T,
size_t SIZE>
659 return etl::lexicographical_compare(
lhs.cbegin(),
671 template <
typename T,
size_t SIZE>
682 template <
typename T,
size_t SIZE>
695 template <
typename T,
size_t SIZE>
709 template <
size_t I,
typename T,
size_t MAXN>
712 ETL_STATIC_ASSERT(
I <
MAXN,
"Index out of bounds");
724 template <
size_t I,
typename T,
size_t MAXN>
727 ETL_STATIC_ASSERT(
I <
MAXN,
"Index out of bounds");
ETL_CONSTEXPR14 etl::enable_if< etl::is_random_iterator< TInputIterator >::value &&etl::is_random_iterator< TOutputIterator >::value, TOutputIterator >::type copy_s(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TOutputIterator o_end)
Definition algorithm.h:2008
ETL_NODISCARD ETL_CONSTEXPR const_reference back() const
Returns a const reference to the last element.
Definition array.h:195
ETL_NODISCARD reverse_iterator rend() ETL_NOEXCEPT
Returns a reverse iterator to the end of the array.
Definition array.h:307
ETL_NODISCARD reference front()
Returns a reference to the first element.
Definition array.h:168
iterator erase(const_iterator first, const_iterator last)
Definition array.h:521
ETL_CONSTEXPR14 void swap(array &other) ETL_NOEXCEPT
Definition array.h:378
void assign(TIterator first, const TIterator last)
Definition array.h:395
ETL_NODISCARD ETL_CONSTEXPR const_reverse_iterator crbegin() const ETL_NOEXCEPT
Returns a const reverse iterator to the reverse beginning of the array.
Definition array.h:298
ETL_NODISCARD ETL_CONSTEXPR const_reverse_iterator rbegin() const ETL_NOEXCEPT
Returns a const reverse iterator to the reverse beginning of the array.
Definition array.h:289
T _buffer[SIZE]
The array data.
Definition array.h:580
ETL_NODISCARD ETL_CONSTEXPR const_iterator begin() const ETL_NOEXCEPT
Returns a const iterator to the beginning of the array.
Definition array.h:235
iterator erase_range(size_t first, size_t last)
Definition array.h:510
ETL_NODISCARD reference at(size_t i)
Definition array.h:118
ETL_CONSTEXPR14 void fill(parameter_t value)
Definition array.h:369
ETL_NODISCARD ETL_CONSTEXPR const_reference at(size_t i) const
Definition array.h:135
iterator insert_at(size_t position, parameter_t value)
Definition array.h:421
iterator erase_range(size_t first, size_t last, parameter_t value)
Definition array.h:559
ETL_NODISCARD ETL_CONSTEXPR const_iterator end() const ETL_NOEXCEPT
Returns a const iterator to the end of the array.
Definition array.h:262
ETL_NODISCARD ETL_CONSTEXPR const_reference front() const
Returns a const reference to the first element.
Definition array.h:177
void assign(TIterator first, const TIterator last, parameter_t value)
Definition array.h:407
iterator erase_at(size_t position)
Definition array.h:486
iterator erase(const_iterator first, const_iterator last, parameter_t value)
Definition array.h:569
iterator erase(const_iterator position, parameter_t value)
Definition array.h:543
ETL_NODISCARD iterator begin() ETL_NOEXCEPT
Returns an iterator to the beginning of the array.
Definition array.h:226
iterator insert(const_iterator position, parameter_t value)
Definition array.h:431
ETL_NODISCARD iterator end() ETL_NOEXCEPT
Returns an iterator to the end of the array.
Definition array.h:253
ETL_NODISCARD ETL_CONSTEXPR const_reverse_iterator crend() const ETL_NOEXCEPT
Returns a const reverse iterator to the end of the array.
Definition array.h:325
ETL_NODISCARD ETL_CONSTEXPR bool empty() const ETL_NOEXCEPT
Returns true if the array size is zero.
Definition array.h:338
ETL_NODISCARD reference operator[](size_t i)
Definition array.h:148
ETL_NODISCARD ETL_CONSTEXPR const_pointer data() const ETL_NOEXCEPT
Returns a const pointer to the first element of the internal buffer.
Definition array.h:213
ETL_NODISCARD ETL_CONSTEXPR size_t size() const ETL_NOEXCEPT
Returns the size of the array.
Definition array.h:347
ETL_NODISCARD ETL_CONSTEXPR const_reference operator[](size_t i) const
Definition array.h:159
ETL_NODISCARD pointer data() ETL_NOEXCEPT
Returns a pointer to the first element of the internal buffer.
Definition array.h:204
iterator insert(const_iterator position, TIterator first, const TIterator last)
Definition array.h:460
ETL_NODISCARD ETL_CONSTEXPR const_iterator cbegin() const ETL_NOEXCEPT
Returns a const iterator to the beginning of the array.
Definition array.h:244
iterator erase(const_iterator position)
Definition array.h:496
iterator erase_at(size_t position, parameter_t value)
Definition array.h:533
iterator insert_at(size_t position, TIterator first, const TIterator last)
Definition array.h:448
ETL_NODISCARD reference back()
Returns a reference to the last element.
Definition array.h:186
ETL_NODISCARD ETL_CONSTEXPR const_reverse_iterator rend() const ETL_NOEXCEPT
Returns a const reverse iterator to the end of the array.
Definition array.h:316
ETL_NODISCARD ETL_CONSTEXPR size_t max_size() const ETL_NOEXCEPT
Returns the maximum possible size of the array.
Definition array.h:356
#define ETL_ASSERT(b, e)
Definition error_handler.h:316
Definition exception.h:47
bitset_ext
Definition absolute.h:38
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:684
T & get(array< T, MAXN > &a)
Definition array.h:710
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:696
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:645
void swap(etl::array< T, SIZE > &lhs, etl::array< T, SIZE > &rhs)
Template deduction guides.
Definition array.h:621
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:633
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:657
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:672
pair holds two objects of arbitrary type
Definition utility.h:164