![]() |
Embedded Template Library
1.0
|
Array view. More...
#include <array_view.h>
Public Member Functions | |
ETL_CONSTEXPR | array_view () |
Default constructor. | |
template<typename TArray > | |
ETL_CONSTEXPR | array_view (TArray &a) |
template<typename TIterator > | |
ETL_CONSTEXPR | array_view (const TIterator begin_, const TIterator end_) |
Construct from iterators. | |
template<typename TIterator , typename TSize > | |
ETL_CONSTEXPR | array_view (const TIterator begin_, const TSize size_) |
Construct from C array. | |
template<size_t ARRAY_SIZE> | |
ETL_CONSTEXPR | array_view (T(&begin_)[ARRAY_SIZE]) |
Construct from C array. | |
ETL_CONSTEXPR | array_view (const array_view &other) |
Copy constructor. | |
reference | front () |
Returns a reference to the first element. | |
const_reference | front () const |
Returns a const reference to the first element. | |
reference | back () |
Returns a reference to the last element. | |
const_reference | back () const |
Returns a const reference to the last element. | |
pointer | data () |
Returns a pointer to the first element of the internal storage. | |
const_pointer | data () const |
Returns a const pointer to the first element of the internal storage. | |
iterator | begin () |
Returns an iterator to the beginning of the array. | |
const_iterator | begin () const |
Returns a const iterator to the beginning of the array. | |
const_iterator | cbegin () const |
Returns a const iterator to the beginning of the array. | |
iterator | end () |
Returns an iterator to the end of the array. | |
const_iterator | end () const |
Returns a const iterator to the end of the array. | |
const_iterator | cend () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
Returns a const reverse iterator to the reverse beginning of the array. | |
const_reverse_iterator | crbegin () const |
Returns a const reverse iterator to the reverse beginning of the array. | |
reverse_iterator | rend () |
Returns a reverse iterator to the end of the array. | |
const_reverse_iterator | rend () const |
Returns a const reverse iterator to the end of the array. | |
const_reverse_iterator | crend () const |
Returns a const reverse iterator to the end of the array. | |
bool | empty () const |
Returns true if the array size is zero. | |
size_t | size () const |
Returns the size of the array. | |
size_t | max_size () const |
Returns the maximum possible size of the array. | |
array_view & | operator= (const array_view &other) |
Assign from a view. | |
template<typename TIterator > | |
void | assign (const TIterator begin_, const TIterator end_) |
Assign from iterators. | |
template<typename TIterator , typename TSize > | |
void | assign (const TIterator begin_, const TSize size_) |
Assign from iterator and size. | |
const_reference | operator[] (const size_t i) const |
Returns a const reference to the indexed value. | |
const_reference | at (const size_t i) const |
Returns a const reference to the indexed value. | |
void | swap (array_view &other) |
Swaps with another array_view. | |
void | remove_prefix (const size_type n) |
Shrinks the view by moving its start forward. | |
void | remove_suffix (const size_type n) |
Shrinks the view by moving its end backward. | |
Friends | |
bool | operator== (const array_view< T > &lhs, const array_view< T > &rhs) |
Equality for array views. | |
bool | operator!= (const array_view< T > &lhs, const array_view< T > &rhs) |
Inequality for array views. | |
bool | operator< (const array_view< T > &lhs, const array_view< T > &rhs) |
Less-than for array views. | |
bool | operator> (const array_view< T > &lhs, const array_view< T > &rhs) |
Greater-than for array views. | |
bool | operator<= (const array_view< T > &lhs, const array_view< T > &rhs) |
Less-than-equal for array views. | |
bool | operator>= (const array_view< T > &lhs, const array_view< T > &rhs) |
Greater-than-equal for array views. | |
Array view.
|
inline |
Construct from std::array or etl::array or other type that supports data() and size() member functions.