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;
274 ETL_CONSTEXPR const_iterator cend()
const ETL_NOEXCEPT
284 reverse_iterator rbegin() ETL_NOEXCEPT
286 return reverse_iterator(
end());
295 return const_reverse_iterator(
end());
304 return const_reverse_iterator(
end());
312 reverse_iterator
rend() ETL_NOEXCEPT
314 return reverse_iterator(
begin());
321 ETL_CONSTEXPR const_reverse_iterator
rend()
const ETL_NOEXCEPT
323 return const_reverse_iterator(
begin());
330 ETL_CONSTEXPR const_reverse_iterator
crend()
const ETL_NOEXCEPT
332 return const_reverse_iterator(
begin());
385 using ETL_OR_STD::swap;
387 for (
size_t i = 0
UL;
i < SIZE; ++
i)
400 template <
typename TIterator>
413 template <
typename TIterator>
420 etl::fill(p,
end(), value);
444 etl::move_backward(p,
end() - 1,
end());
456 template <
typename TIterator>
468 template <
typename TIterator>
481 etl::move_backward(p, p + length,
end());
508 etl::move(p + 1,
end(), p);
533 etl::move(last, cend(), p);
556 etl::move(p + 1,
end(), p);
582 p = etl::move(last, cend(), p);
583 etl::fill(p,
end(), value);
585 return to_iterator(first);
602 template <
typename T,
size_t SIZE_>
603 ETL_CONSTANT
size_t array<T, SIZE_>::SIZE;
609 template <
typename... T>
616#if ETL_HAS_INITIALIZER_LIST
617 template <
typename T,
typename... TValues>
618 constexpr auto make_array(TValues&&... values) ->
etl::array<T,
sizeof...(TValues)>
629 template <
typename T, const
size_t SIZE>
641 template <
typename T,
size_t SIZE>
644 return etl::equal(
lhs.cbegin(),
lhs.cend(),
rhs.cbegin());
653 template <
typename T,
size_t SIZE>
665 template <
typename T,
size_t SIZE>
668 return etl::lexicographical_compare(
lhs.cbegin(),
680 template <
typename T,
size_t SIZE>
691 template <
typename T,
size_t SIZE>
704 template <
typename T,
size_t SIZE>
718 template <
size_t I,
typename T,
size_t MAXN>
721 ETL_STATIC_ASSERT(
I <
MAXN,
"Index out of bounds");
733 template <
size_t I,
typename T,
size_t MAXN>
736 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:2248
ETL_NODISCARD ETL_CONSTEXPR const_reference back() const
Returns a const reference to the last element.
Definition array.h:195
iterator erase(const_iterator first, const_iterator last)
Definition array.h:530
ETL_CONSTEXPR14 void swap(array &other) ETL_NOEXCEPT
Definition array.h:383
ETL_NODISCARD ETL_CONSTEXPR14 reverse_iterator rend() ETL_NOEXCEPT
Returns a reverse iterator to the end of the array.
Definition array.h:312
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:302
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:293
ETL_NODISCARD ETL_CONSTEXPR14 iterator begin() ETL_NOEXCEPT
Returns an iterator to the beginning of the array.
Definition array.h:228
T _buffer[SIZE]
The array data.
Definition array.h:589
ETL_NODISCARD ETL_CONSTEXPR14 reference back()
Returns a reference to the last element.
Definition array.h:186
ETL_NODISCARD ETL_CONSTEXPR const_iterator begin() const ETL_NOEXCEPT
Returns a const iterator to the beginning of the array.
Definition array.h:237
ETL_NODISCARD ETL_CONSTEXPR14 const_reference at(size_t i) const
Definition array.h:132
ETL_NODISCARD ETL_CONSTEXPR14 reference at(size_t i)
Definition array.h:119
ETL_NODISCARD ETL_CONSTEXPR14 pointer data() ETL_NOEXCEPT
Returns a pointer to the first element of the internal buffer.
Definition array.h:205
ETL_NODISCARD ETL_CONSTEXPR14 reference front()
Returns a reference to the first element.
Definition array.h:167
iterator erase_range(size_t first, size_t last)
Definition array.h:519
ETL_CONSTEXPR14 void fill(parameter_t value)
Definition array.h:374
iterator insert_at(size_t position, parameter_t value)
Definition array.h:430
iterator erase_range(size_t first, size_t last, parameter_t value)
Definition array.h:568
ETL_NODISCARD ETL_CONSTEXPR const_iterator end() const ETL_NOEXCEPT
Returns a const iterator to the end of the array.
Definition array.h:265
ETL_NODISCARD ETL_CONSTEXPR const_reference front() const
Returns a const reference to the first element.
Definition array.h:176
iterator erase_at(size_t position)
Definition array.h:495
iterator erase(const_iterator first, const_iterator last, parameter_t value)
Definition array.h:578
iterator erase(const_iterator position, parameter_t value)
Definition array.h:552
ETL_NODISCARD ETL_CONSTEXPR14 iterator end() ETL_NOEXCEPT
Returns an iterator to the end of the array.
Definition array.h:256
iterator insert(const_iterator position, parameter_t value)
Definition array.h:440
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:330
ETL_NODISCARD ETL_CONSTEXPR bool empty() const ETL_NOEXCEPT
Returns true if the array size is zero.
Definition array.h:343
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:214
ETL_NODISCARD ETL_CONSTEXPR size_t size() const ETL_NOEXCEPT
Returns the size of the array.
Definition array.h:352
ETL_NODISCARD ETL_CONSTEXPR const_reference operator[](size_t i) const
Definition array.h:157
iterator insert(const_iterator position, TIterator first, const TIterator last)
Definition array.h:469
iterator assign(TIterator first, const TIterator last)
Definition array.h:401
ETL_NODISCARD ETL_CONSTEXPR const_iterator cbegin() const ETL_NOEXCEPT
Returns a const iterator to the beginning of the array.
Definition array.h:246
iterator erase(const_iterator position)
Definition array.h:505
iterator assign(TIterator first, const TIterator last, parameter_t value)
Definition array.h:414
ETL_NODISCARD ETL_CONSTEXPR14 reference operator[](size_t i)
Definition array.h:146
iterator erase_at(size_t position, parameter_t value)
Definition array.h:542
iterator insert_at(size_t position, TIterator first, const TIterator last)
Definition array.h:457
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:321
ETL_NODISCARD ETL_CONSTEXPR size_t max_size() const ETL_NOEXCEPT
Returns the maximum possible size of the array.
Definition array.h:361
#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:693
T & get(array< T, MAXN > &a)
Definition array.h:719
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:705
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:654
void swap(etl::array< T, SIZE > &lhs, etl::array< T, SIZE > &rhs)
Template deduction guides.
Definition array.h:630
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:642
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:666
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:681
pair holds two objects of arbitrary type
Definition utility.h:164