Embedded Template Library 1.0
etl::back_insert_iterator< TContainer > Class Template Reference

Turns assignment into insertion. More...

#include <iterator.h>

Public Types

typedef TContainer container_type
 A nested typedef for the type of whatever container you used.
 
- Public Types inherited from etl::iterator< ETL_OR_STD::output_iterator_tag, void, void, void, void >
typedef void value_type
 
typedef void difference_type
 
typedef void pointer
 
typedef void reference
 
typedef ETL_OR_STD::output_iterator_tag iterator_category
 

Public Member Functions

ETL_CONSTEXPR14 back_insert_iterator (TContainer &c)
 The only way to create this iterator is with a container.
 
ETL_CONSTEXPR14 back_insert_iteratoroperator= (const typename TContainer::value_type &value)
 
ETL_NODISCARD ETL_CONSTEXPR14 back_insert_iteratoroperator* ()
 
ETL_CONSTEXPR14 back_insert_iteratoroperator++ ()
 
ETL_CONSTEXPR14 back_insert_iterator operator++ (int)
 

Protected Attributes

TContainer * container
 

Detailed Description

template<typename TContainer>
class etl::back_insert_iterator< TContainer >

Turns assignment into insertion.

These are output iterators, constructed from a container-of-T. Assigning a T to the iterator appends it to the container using push_back.

Template Parameters
TContainer

Member Function Documentation

◆ operator*()

template<typename TContainer >
ETL_NODISCARD ETL_CONSTEXPR14 back_insert_iterator & etl::back_insert_iterator< TContainer >::operator* ( )
inline

Dereference operator. Simply returns *this.

◆ operator++() [1/2]

template<typename TContainer >
ETL_CONSTEXPR14 back_insert_iterator & etl::back_insert_iterator< TContainer >::operator++ ( )
inline

Pre-increment operator. Simply returns *this. (This iterator does not move.)

◆ operator++() [2/2]

template<typename TContainer >
ETL_CONSTEXPR14 back_insert_iterator etl::back_insert_iterator< TContainer >::operator++ ( int  )
inline

Post-increment operator. Simply returns *this. (This iterator does not move.)

◆ operator=()

template<typename TContainer >
ETL_CONSTEXPR14 back_insert_iterator & etl::back_insert_iterator< TContainer >::operator= ( const typename TContainer::value_type &  value)
inline

This kind of iterator doesn't really have a position in the container (you can think of the position as being permanently at the end, if you like). Assigning a value to the iterator will always append the value to the end of the container.

Parameters
valueAn instance of whatever type container_type::const_reference is; presumably a reference-to-const T for container<T>.
Returns
This iterator, for chained operations.

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