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...
 
template<typename V >
auto operator= (V &&value) noexcept(noexcept(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 1543 of file iterators.h.

Member Typedef Documentation

◆ difference_type

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

Definition at line 1549 of file iterators.h.

◆ iterator_category

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

Definition at line 1552 of file iterators.h.

◆ pointer

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

Definition at line 1550 of file iterators.h.

◆ reference

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

Definition at line 1551 of file iterators.h.

◆ value_type

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

Definition at line 1548 of file iterators.h.

Constructor & Destructor Documentation

◆ consume_iterator()

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 1559 of file iterators.h.

Member Function Documentation

◆ operator*()

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

A no-op.

Definition at line 1578 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 1582 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 1586 of file iterators.h.

◆ operator=()

template<typename F >
template<typename V >
auto kblib::consume_iterator< F >::operator= ( V &&  value) -> consume_iterator&
inlinenoexcept

Pass value to F.

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

Definition at line 1569 of file iterators.h.


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