Loading...
Searching...
No Matches
etl::array_view< T > Class Template Reference

Array view. More...

`#include <array_view.h>`

## Public Types

typedef T | value_type
typedef size_t | size_type
typedef const T & | const_reference
typedef const T * | const_pointer
typedef const T * | const_iterator
typedef ETL_OR_STD::reverse_iterator< const_iterator > | const_reverse_iterator
typedef const_pointer | pointer
typedef const_reference | reference
typedef const_pointer | iterator
typedef const_reverse_iterator | reverse_iterator

## Public Member Functions

ETL_CONSTEXPR | array_view () ETL_NOEXCEPT
| Default constructor.
template<typename U, size_t Size>
ETL_CONSTEXPR | array_view (etl::array< U, Size > &a, typename etl::enable_if< etl::is_same< typename etl::remove_cv< T >::type, typename etl::remove_cv< U >::type >::value, void >::type *=0) ETL_NOEXCEPT
| Construct from etl::array.
template<typename U, size_t Size>
ETL_CONSTEXPR | array_view (const etl::array< U, Size > &a, typename etl::enable_if< etl::is_same< typename etl::remove_cv< T >::type, typename etl::remove_cv< U >::type >::value, void >::type *=0) ETL_NOEXCEPT
| Construct from etl::array.
template<typename TContainer>
ETL_CONSTEXPR | array_view (TContainer &a, typename etl::enable_if< !etl::is_pointer< typename etl::remove_reference< TContainer >::type >::value &&!etl::is_array< TContainer >::value &&etl::is_same< typename etl::remove_cv< T >::type, typename etl::remove_cv< typename etl::remove_reference< TContainer >::type::value_type >::type >::value, void >::type *=0) ETL_NOEXCEPT
template<typename TContainer>
ETL_CONSTEXPR | array_view (const TContainer &a, typename etl::enable_if< !etl::is_pointer< typename etl::remove_reference< TContainer >::type >::value &&!etl::is_array< TContainer >::value &&etl::is_same< typename etl::remove_cv< T >::type, typename etl::remove_cv< typename etl::remove_reference< TContainer >::type::value_type >::type >::value, void >::type *=0) ETL_NOEXCEPT
template<typename TIterator>
ETL_CONSTEXPR | array_view (const TIterator begin_, const TIterator end_) ETL_NOEXCEPT
| Construct from iterators.
template<typename TIterator, typename TSize>
ETL_CONSTEXPR | array_view (const TIterator begin_, const TSize size_) ETL_NOEXCEPT
| Construct from iterator and size.
template<size_t Array_Size>
ETL_CONSTEXPR | array_view (T(&begin_)[Array_Size]) ETL_NOEXCEPT
| Construct from C array.
ETL_CONSTEXPR | array_view (const array_view &other) ETL_NOEXCEPT
| Copy constructor.
reference | front ()
const_reference | front () const
reference | back ()
const_reference | back () const
pointer | data () ETL_NOEXCEPT
| Returns a pointer to the first element of the internal storage.
const_pointer | data () const ETL_NOEXCEPT
| Returns a const pointer to the first element of the internal storage.
iterator | begin () ETL_NOEXCEPT
| Returns an iterator to the beginning of the array.
const_iterator | begin () const ETL_NOEXCEPT
| Returns a const iterator to the beginning of the array.
const_iterator | cbegin () const ETL_NOEXCEPT
| Returns a const iterator to the beginning of the array.
iterator | end () ETL_NOEXCEPT
| Returns an iterator to the end of the array.
const_iterator | end () const ETL_NOEXCEPT
| Returns a const iterator to the end of the array.
const_iterator | cend () const ETL_NOEXCEPT
reverse_iterator | rbegin () ETL_NOEXCEPT
const_reverse_iterator | rbegin () const ETL_NOEXCEPT
| Returns a const reverse iterator to the reverse beginning of the array.
const_reverse_iterator | crbegin () const ETL_NOEXCEPT
| Returns a const reverse iterator to the reverse beginning of the array.
reverse_iterator | rend () ETL_NOEXCEPT
| Returns a reverse iterator to the end of the array.
const_reverse_iterator | rend () const ETL_NOEXCEPT
| Returns a const reverse iterator to the end of the array.
const_reverse_iterator | crend () const ETL_NOEXCEPT
| Returns a const reverse iterator to the end of the array.
ETL_CONSTEXPR bool | empty () const ETL_NOEXCEPT
| Returns true if the array size is zero.
ETL_CONSTEXPR size_t | size () const ETL_NOEXCEPT
| Returns the size of the array.
ETL_CONSTEXPR size_t | max_size () const ETL_NOEXCEPT
| Returns the maximum possible size of the array.
array_view & | operator= (const array_view &other) ETL_NOEXCEPT
| 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 ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS||ETL_NOT_CHECKING_INDEX_OPERATOR)
const_reference | at (const size_t i) const
| Returns a const reference to the indexed value.
void | swap (array_view &other) ETL_NOEXCEPT
| Swaps with another array_view.
void | remove_prefix (const size_type n) ETL_NOEXCEPT
| Shrinks the view by moving its start forward.
void | remove_suffix (const size_type n) ETL_NOEXCEPT
| Shrinks the view by moving its end backward.
void | fill (const T &value)
| Fills the array.

## 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.

## Detailed Description

template<typename T>
class etl::array_view< T >

Array view.

## Constructor & Destructor Documentation

## array_view() [1/2]

template<typename T>
template<typename TContainer>

ETL_CONSTEXPR etl::array_view< T >::array_view | ( | TContainer & | a,
|  | typename etl::enable_if< !etl::is_pointer< typename etl::remove_reference< TContainer >::type >::value &&!etl::is_array< TContainer >::value &&etl::is_same< typename etl::remove_cv< T >::type, typename etl::remove_cv< typename etl::remove_reference< TContainer >::type::value_type >::type >::value, void >::type * | = 0 )

inline

Construct from a container or other type that supports data() and size() member functions.

## array_view() [2/2]

template<typename T>
template<typename TContainer>

ETL_CONSTEXPR etl::array_view< T >::array_view | ( | const TContainer & | a,
|  | typename etl::enable_if< !etl::is_pointer< typename etl::remove_reference< TContainer >::type >::value &&!etl::is_array< TContainer >::value &&etl::is_same< typename etl::remove_cv< T >::type, typename etl::remove_cv< typename etl::remove_reference< TContainer >::type::value_type >::type >::value, void >::type * | = 0 )

inline

Construct from a container or other type that supports data() and size() member functions.

## Member Function Documentation

## back() [1/2]

template<typename T>

reference etl::array_view< T >::back | ( |  | ) |

inline

Returns a reference to the last element. If asserts or exceptions are enabled, throws an etl::array_view_empty if the view is empty.

## back() [2/2]

template<typename T>

const_reference etl::array_view< T >::back | ( |  | ) | const

inline

Returns a const reference to the last element. If asserts or exceptions are enabled, throws an etl::array_view_empty if the view is empty.

## front() [1/2]

template<typename T>

reference etl::array_view< T >::front | ( |  | ) |

inline

Returns a reference to the first element. If asserts or exceptions are enabled, throws an etl::array_view_empty if the view is empty.

## front() [2/2]

template<typename T>

const_reference etl::array_view< T >::front | ( |  | ) | const

inline

Returns a const reference to the first element. If asserts or exceptions are enabled, throws an etl::array_view_empty if the view is empty.

## operator[]()

template<typename T>

const_reference etl::array_view< T >::operator[] | ( | const size_t | i | ) | const

inline

Returns a const reference to the indexed value. If asserts or exceptions are enabled, throws an etl::array_view_bounds if the index is out of bounds.

The documentation for this class was generated from the following file:

- include/etl/array_view.h