40 #include "static_assert.h"
42 #ifndef ETL_THROW_EXCEPTIONS
84 template <
typename T, const
size_t SIZE>
94 typedef std::size_t size_type;
95 typedef std::ptrdiff_t difference_type;
97 typedef const T& const_reference;
99 typedef const T* const_pointer;
101 typedef const T* const_iterator;
102 typedef std::reverse_iterator<iterator> reverse_iterator;
103 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
115 reference
at(
size_t i)
120 #ifdef ETL_THROW_EXCEPTIONS
136 const_reference
at(
size_t i)
const
140 #ifdef ETL_THROW_EXCEPTIONS
257 const_iterator
end()
const
265 const_iterator cend()
const
273 reverse_iterator rbegin()
275 return reverse_iterator(
end());
283 return const_reverse_iterator(
end());
291 return const_reverse_iterator(
end());
299 return reverse_iterator(
begin());
305 const_reverse_iterator
rend()
const
307 return const_reverse_iterator(
begin());
313 const_reverse_iterator
crend()
const
315 return const_reverse_iterator(
begin());
365 for (
size_t i = 0; i < SIZE; ++i)
380 template <
typename T, const
size_t SIZE>
392 template <
typename T, std::
size_t SIZE>
395 return std::equal(lhs.
cbegin(), lhs.cend(), rhs.
cbegin());
404 template <
typename T, std::
size_t SIZE>
407 return !(lhs == rhs);
416 template <
typename T, std::
size_t SIZE>
419 return std::lexicographical_compare(lhs.cbegin(),
431 template <
typename T, std::
size_t SIZE>
434 return !std::lexicographical_compare(lhs.cbegin(),
446 template <
typename T, std::
size_t SIZE>
450 return std::lexicographical_compare(lhs.
cbegin(),
463 template <
typename T, std::
size_t SIZE>
466 return !std::lexicographical_compare(lhs.
cbegin(),
480 template <std::
size_t I,
typename T, std::
size_t N>
481 inline T&
get(array<T, N>& a)
483 STATIC_ASSERT(I < N,
"Index out of bounds");
495 template <std::
size_t I,
typename T, std::
size_t N>
496 inline const T&
get(
const array<T, N>& a)
498 STATIC_ASSERT(I < N,
"Index out of bounds");
const_reference operator[](size_t i) const
Definition: array.h:165
pointer data()
Returns a pointer to the first element of the internal buffer.
Definition: array.h:205
reference operator[](size_t i)
Definition: array.h:155
bool empty() const
Returns true if the array size is zero.
Definition: array.h:325
void fill(parameter_t value)
Definition: array.h:354
const_reverse_iterator crbegin() const
Returns a const reverse iterator to the reverse beginning of the array.
Definition: array.h:289
void swap(etl::bitset< N > &lhs, etl::bitset< N > &rhs)
swap
Definition: bitset.h:1200
Determine how to pass parameters.
Definition: parameter_type.h:40
size_t max_size() const
Returns the maximum possible size of the array.
Definition: array.h:341
reference at(size_t i)
Definition: array.h:115
size_t size() const
Returns the size of the array.
Definition: array.h:333
const_iterator end() const
Returns a const iterator to the end of the array.
Definition: array.h:257
exception(value_type reason)
Constructor.
Definition: exception.h:51
Definition: algorithm.h:43
iterator begin()
Returns an iterator to the beginning of the array.
Definition: array.h:225
reference back()
Returns a reference to the last element.
Definition: array.h:189
const_pointer data() const
Returns a const pointer to the first element of the internal buffer.
Definition: array.h:213
const_iterator begin() const
Returns a const iterator to the beginning of the array.
Definition: array.h:233
const_reverse_iterator rend() const
Returns a const reverse iterator to the end of the array.
Definition: array.h:305
Definition: exception.h:42
const_iterator cbegin() const
Returns a const iterator to the beginning of the array.
Definition: array.h:241
iterator end()
Returns an iterator to the end of the array.
Definition: array.h:249
const_reverse_iterator crend() const
Returns a const reverse iterator to the end of the array.
Definition: array.h:313
value_type what() const
Definition: exception.h:60
static void error(const exception &e)
Definition: error_handler.cpp:50
const_reference back() const
Returns a const reference to the last element.
Definition: array.h:197
reverse_iterator rend()
Returns a reverse iterator to the end of the array.
Definition: array.h:297
T _buffer[SIZE]
The array data.
Definition: array.h:372
void swap(array &other)
Definition: array.h:363
const_reference front() const
Returns a const reference to the first element.
Definition: array.h:181
const_reverse_iterator rbegin() const
Returns a const reverse iterator to the reverse beginning of the array.
Definition: array.h:281
reference front()
Returns a reference to the first element.
Definition: array.h:173
const_reference at(size_t i) const
Definition: array.h:136