Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
Public Types | Public Member Functions
ext::callback_iterator< T > Class Template Reference

Output iterator calling a callback function on assignment. More...

#include <iterator.hpp>

Public Types

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

Public Member Functions

 callback_iterator (T callback)
 
template<class R >
callback_iteratoroperator= (R &&value)
 
callback_iteratoroperator* ()
 
callback_iteratoroperator++ ()
 
callback_iterator operator++ (int)
 

Detailed Description

template<class T>
class ext::callback_iterator< T >

Output iterator calling a callback function on assignment.

Template Parameters
thetype of value accepted by the callback. The type must include the reference and cv-qualification if needed.

Member Typedef Documentation

◆ difference_type

template<class T >
using ext::callback_iterator< T >::difference_type = void

◆ iterator_category

template<class T >
using ext::callback_iterator< T >::iterator_category = std::output_iterator_tag

◆ pointer

template<class T >
using ext::callback_iterator< T >::pointer = void

◆ reference

template<class T >
using ext::callback_iterator< T >::reference = void

◆ value_type

template<class T >
using ext::callback_iterator< T >::value_type = void

Constructor & Destructor Documentation

◆ callback_iterator()

template<class T >
ext::callback_iterator< T >::callback_iterator ( callback)
inlineexplicit

Constructor of the callback iterator based on callback

Parameters
callbackthe function to call on asignment

Member Function Documentation

◆ operator*()

template<class T >
callback_iterator & ext::callback_iterator< T >::operator* ( )
inline

Typical implementation of output iterator dereference operator producing itself.

Returns
reference to this output iterator

◆ operator++() [1/2]

template<class T >
callback_iterator & ext::callback_iterator< T >::operator++ ( )
inline

Increment operator implementation as no operation.

Returns
reference to this output iterator

◆ operator++() [2/2]

template<class T >
callback_iterator ext::callback_iterator< T >::operator++ ( int  )
inline

Increment operator implementation as no operation.

Returns
reference to this output iterator

◆ operator=()

template<class T >
template<class R >
callback_iterator & ext::callback_iterator< T >::operator= ( R &&  value)
inline

Asignment operator calling the calback with the accepted parameter.

Parameters
valuethe value to pass to the callback
Returns
reference to this iterator

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