tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
back_insert_iterator< Container > Struct Template Reference

etl::back_insert_iterator is a LegacyOutputIterator that appends to a container for which it was constructed. The container's push_back() member function is called whenever the iterator (whether dereferenced or not) is assigned to. Incrementing the etl::back_insert_iterator is a no-op. More...

#include <back_insert_iterator.hpp>

Public Types

using container_type = Container
 
using difference_type = ptrdiff_t
 
using iterator_category = output_iterator_tag
 
using pointer = void
 
using reference = void
 
using value_type = void
 

Public Member Functions

constexpr back_insert_iterator () noexcept=default
 Initializes the underlying pointer to container with nullptr.
 
constexpr back_insert_iterator (Container &container)
 Initializes the underlying pointer to the container to etl::addressof(c).
 
constexpr auto operator* () -> back_insert_iterator &
 Does nothing, this member function is provided to satisfy the requirements of LegacyOutputIterator. It returns the iterator itself, which makes it possible to use code such as *iter = value to output (insert) the value into the underlying container.
 
constexpr auto operator++ () -> back_insert_iterator &
 Does nothing. These operator overloads are provided to satisfy the requirements of LegacyOutputIterator. They make it possible for the expressions *iter++=value and *++iter=value to be used to output (insert) a value into the underlying container.
 
constexpr auto operator++ (int) -> back_insert_iterator
 Does nothing. These operator overloads are provided to satisfy the requirements of LegacyOutputIterator. They make it possible for the expressions *iter++=value and *++iter=value to be used to output (insert) a value into the underlying container.
 
constexpr auto operator= (typename Container::value_type &&value) -> back_insert_iterator &
 Inserts the given value value to the container.
 
constexpr auto operator= (typename Container::value_type const &value) -> back_insert_iterator &
 Inserts the given value value to the container.
 

Detailed Description

template<typename Container>
struct etl::back_insert_iterator< Container >

etl::back_insert_iterator is a LegacyOutputIterator that appends to a container for which it was constructed. The container's push_back() member function is called whenever the iterator (whether dereferenced or not) is assigned to. Incrementing the etl::back_insert_iterator is a no-op.

Member Typedef Documentation

◆ container_type

template<typename Container>
using container_type = Container

◆ difference_type

template<typename Container>
using difference_type = ptrdiff_t

◆ iterator_category

template<typename Container>
using iterator_category = output_iterator_tag

◆ pointer

template<typename Container>
using pointer = void

◆ reference

template<typename Container>
using reference = void

◆ value_type

template<typename Container>
using value_type = void

Constructor & Destructor Documentation

◆ back_insert_iterator() [1/2]

template<typename Container>
back_insert_iterator ( )
constexprdefaultnoexcept

Initializes the underlying pointer to container with nullptr.

◆ back_insert_iterator() [2/2]

template<typename Container>
back_insert_iterator ( Container & container)
inlineexplicitconstexpr

Initializes the underlying pointer to the container to etl::addressof(c).

Member Function Documentation

◆ operator*()

template<typename Container>
auto operator* ( ) -> back_insert_iterator&
inlineconstexpr

Does nothing, this member function is provided to satisfy the requirements of LegacyOutputIterator. It returns the iterator itself, which makes it possible to use code such as *iter = value to output (insert) the value into the underlying container.

◆ operator++() [1/2]

template<typename Container>
auto operator++ ( ) -> back_insert_iterator&
inlineconstexpr

Does nothing. These operator overloads are provided to satisfy the requirements of LegacyOutputIterator. They make it possible for the expressions *iter++=value and *++iter=value to be used to output (insert) a value into the underlying container.

◆ operator++() [2/2]

template<typename Container>
auto operator++ ( int ) -> back_insert_iterator
inlineconstexpr

Does nothing. These operator overloads are provided to satisfy the requirements of LegacyOutputIterator. They make it possible for the expressions *iter++=value and *++iter=value to be used to output (insert) a value into the underlying container.

◆ operator=() [1/2]

template<typename Container>
auto operator= ( typename Container::value_type && value) -> back_insert_iterator&
inlineconstexpr

Inserts the given value value to the container.

◆ operator=() [2/2]

template<typename Container>
auto operator= ( typename Container::value_type const & value) -> back_insert_iterator&
inlineconstexpr

Inserts the given value value to the container.


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