BloombergLP::bdlb::FunctionOutputIterator

Provide an output iterator that calls an object of the (template parameter) type FUNCTION. If FUNCTION is a functor, de-referencing this iterator and assigning to the result (of dereferencing) will call the operator() of the functor with the assigned value as a parameter. Similarly, if FUNCTION if a function pointer type, assigning to the dereferenced iterator will call the function supplied at construction with the assigned value as a parameter.

Synopsis

Declared in <bdlb_functionoutputiterator.h>

template<class FUNCTION>
class FunctionOutputIterator;

Type Aliases

NameDescription
difference_type Unused difference type required by iterator_traits (always void).
iterator_category Tag identifying this type as an output iterator.
pointer Unused pointer type required by iterator_traits (always void).
reference Unused reference type required by iterator_traits (always void).
value_type Unused value type required by iterator_traits (always void).

Member Functions

NameDescription
FunctionOutputIterator [constructor]Constructors
operator* Return an object that can appear on the left-hand side of an assignment from TYPE. When a value is assigned to the returned value, invoke the functor or function indicated at construction supplying the assigned value as the parameter. This function is non-const in accordance with the input iterator requirements, even though *this is not modified. Note that if FUNCTION is a function pointer type and a valid function pointer was not supplied at construction, then the behavior when assigning to a dereferenced iterator will be undefined.

Non-Member Functions

NameDescription
operator++Do nothing and return specified iterator.
operator++Do nothing and return specified iterator.