kblib 0.2.3
General utilities library for modern C++
kblib::consume_iterator< F > Class Template Reference

An OutputIterator that simply calls a provided functor for each value assigned to it. More...

#include <kblib/iterators.h>

Public Types

using value_type = void
 
using difference_type = void
 
using pointer = void
 
using reference = void
 
using iterator_category = std::output_iterator_tag
 

Public Member Functions

 consume_iterator (F f)
 Constructs a consume_iterator with the given function object. More...
 
 consume_iterator (const consume_iterator &)=default
 
 consume_iterator (consume_iterator &&)=default
 
auto operator= (const consume_iterator &) &-> consume_iterator &=default
 
auto operator= (consume_iterator &&) &-> consume_iterator &=default
 
 ~consume_iterator ()=default
 
template<typename V >
auto operator= (V &&value) noexcept(noexcept(kblib::invoke(fun, std::forward< V >(value)))) -> kblib::ignore_t< decltype(kblib::invoke(fun, std::forward< V >(value))), consume_iterator & >
 Pass value to F. More...
 
auto operator* () -> consume_iterator &
 A no-op. More...
 
auto operator++ () -> consume_iterator &
 A no-op. More...
 
auto operator++ (int) -> consume_iterator &
 A no-op. More...
 

Detailed Description

template<typename F>
class kblib::consume_iterator< F >

An OutputIterator that simply calls a provided functor for each value assigned to it.

Definition at line 1550 of file iterators.h.

Member Typedef Documentation

◆ difference_type

template<typename F >
using kblib::consume_iterator< F >::difference_type = void

Definition at line 1556 of file iterators.h.

◆ iterator_category

template<typename F >
using kblib::consume_iterator< F >::iterator_category = std::output_iterator_tag

Definition at line 1559 of file iterators.h.

◆ pointer

template<typename F >
using kblib::consume_iterator< F >::pointer = void

Definition at line 1557 of file iterators.h.

◆ reference

template<typename F >
using kblib::consume_iterator< F >::reference = void

Definition at line 1558 of file iterators.h.

◆ value_type

template<typename F >
using kblib::consume_iterator< F >::value_type = void

Definition at line 1555 of file iterators.h.

Constructor & Destructor Documentation

◆ consume_iterator() [1/3]

template<typename F >
kblib::consume_iterator< F >::consume_iterator ( f)
inlineexplicit

Constructs a consume_iterator with the given function object.

Parameters
fThe functor to pass values to.

Definition at line 1566 of file iterators.h.

◆ consume_iterator() [2/3]

template<typename F >
kblib::consume_iterator< F >::consume_iterator ( const consume_iterator< F > &  )
default

◆ consume_iterator() [3/3]

template<typename F >
kblib::consume_iterator< F >::consume_iterator ( consume_iterator< F > &&  )
default

◆ ~consume_iterator()

template<typename F >
kblib::consume_iterator< F >::~consume_iterator ( )
default

Member Function Documentation

◆ operator*()

template<typename F >
auto kblib::consume_iterator< F >::operator* ( ) -> consume_iterator&
inline

A no-op.

Definition at line 1593 of file iterators.h.

◆ operator++() [1/2]

template<typename F >
auto kblib::consume_iterator< F >::operator++ ( ) -> consume_iterator&
inline

A no-op.

Definition at line 1597 of file iterators.h.

◆ operator++() [2/2]

template<typename F >
auto kblib::consume_iterator< F >::operator++ ( int  ) -> consume_iterator&
inline

A no-op.

Definition at line 1601 of file iterators.h.

◆ operator=() [1/3]

template<typename F >
auto kblib::consume_iterator< F >::operator= ( const consume_iterator< F > &  ) & -> consume_iterator &=default
default

◆ operator=() [2/3]

template<typename F >
auto kblib::consume_iterator< F >::operator= ( consume_iterator< F > &&  ) & -> consume_iterator &=default
default

◆ operator=() [3/3]

template<typename F >
template<typename V >
auto kblib::consume_iterator< F >::operator= ( V &&  value) -> kblib::ignore_t<decltype(kblib::invoke(fun, std::forward<V>(value))), consume_iterator&>
inlinenoexcept

Pass value to F.

Parameters
valueThe argument for the functor.
Returns
consume_iterator& *this.

Definition at line 1582 of file iterators.h.


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