The transform iterator class itself. Its job is to hold a functor and an iterator, pass through all iterator‐related operations to the held iterator, and on dereference, call the functor on the result of dereferencing the iterator and return the result of the call instead.

Synopsis

Base Classes

Name

Description

TransformIterator_AllocatorOfIteratorMethod<TransformIterator<FUNCTOR, ITERATOR>, bslma::UsesBslmaAllocator<ITERATOR>::value>

The TransformIterator_AllocatorOfIteratorMethod class template has an allocator method when its boolean template parameter is true, which will be made to be the case when the iterator of the transform iterator uses allocators. The transform iterator type itself is supplied as BASE_TYPE.

TransformIterator_AllocatorOfFunctorMethod<TransformIterator<FUNCTOR, ITERATOR>, !bslma::UsesBslmaAllocator<ITERATOR>::value && bslma::UsesBslmaAllocator<FUNCTOR>::value>

The TransformIterator_AllocatorOfFunctorMethod class template has an allocator method when its boolean template parameter is true, which will be made to be the case when the iterator of the transform iterator does not use allocators and the functor of the transform iterator uses allocators. The transform iterator type itself is supplied as BASE_TYPE.

Type Aliases

Name

Description

difference_type

Type used to represent distances between iterators.

iterator_category

Iterator category of this transform iterator.

pointer

Pointer type for this iterator.

reference

Reference type returned by dereferencing this iterator.

value_type

Value type produced by dereferencing this iterator.

Member Functions

Name

Description

TransformIterator [constructor]

Constructors

operator=

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

functor

functor overloads

iterator

iterator overloads

operator*

Return the result of applying the functor of this object to the result of dereferencing the underlying iterator. The behavior is undefined if dereferencing the underlying iterator is undefined. Note that the behavior of this method is equivalent to: ` functor()(*iterator()) `

operator++

Increment the underlying iterator of this object, and return a reference providing modifiable access to this object. The behavior is undefined if incrementing the underlying iterator is undefined.

operator+=

Advance the underlying iterator of this object by the specified (signed) offset, and return a reference providing modifiable access to this object. The behavior is undefined if so advancing the underlying iterator is undefined.

operator‐‐

Decrement the underlying iterator of this object, and return a reference providing modifiable access to this object. The behavior is undefined if decrementing the underlying iterator is undefined.

operator‐=

Regress the underlying iterator of this object by the specified (signed) offset, and return a reference providing modifiable access to this object. The behavior is undefined if so regressing the underlying iterator is undefined.

operator‐>

Return the address of the result of applying the functor of this object to the result of dereferencing the underlying iterator. The behavior is undefined if dereferencing the underlying iterator is undefined. Note that the behavior of this method is equivalent to: ` &functor()(*iterator()) ` Also note that the functor must return a reference type for this method to be used.

operator[]

Return the result of applying the functor of this object to the result of dereferencing the underlying iterator advanced by the specified (signed) offset. The behavior is undefined if so advancing or dereferencing the underlying iterator is undefined. Note that the behavior of this method is equivalent to: ` functor()(iterator()[offset]) `

swap

Efficiently exchange the value of this object with the value of the specified other object by applying swap to each of the functor and underlying iterator fields of the two objects.

operator BloombergLP::bslmf::NestedTraitDeclaration<TransformIterator, UsesBslmaAllocator, bslma::UsesBslmaAllocator<ITERATOR>::value || bslma::UsesBslmaAllocator<FUNCTOR>::value>

Nested trait declaration for bslma::UsesBslmaAllocator.

Non-Member Functions

Name

Description

operator!=

Return true if the underlying iterator of the specified lhs compares unequal to the underlying iterator of the specified rhs, and false otherwise. The behavior is undefined if comparing the underlying iterators in this way is undefined. Note that the functors are not compared.

operator+

Return a copy of the specified iterator object with its underlying iterator advanced by the specified (signed) offset from that of iterator. The behavior is undefined if so advancing the underlying iterator is undefined.

operator+

Return a copy of the specified iterator object with its underlying iterator advanced by the specified (signed) offset from that of iterator. The behavior is undefined if so advancing the underlying iterator is undefined.

operator++

Increment the underlying iterator of the specified iterator, and return a copy of iterator before the increment. The behavior is undefined if incrementing the underlying iterator is undefined.

operator‐

Return the result of subtracting the underlying iterator of the specified a object from the underlying iterator of the specified b object. The behavior is undefined if this subtraction is undefined.

operator‐

Return a copy of the specified iterator object with its underlying iterator regressed by the specified (signed) offset from that of iterator. The behavior is undefined if so regressing the underlying iterator is undefined.

operator‐‐

Decrement the underlying iterator of the specified iterator, and return a copy of iterator before the decrement. The behavior is undefined if decrementing the underlying iterator is undefined.

operator<

Return true if the underlying iterator of the specified lhs compares less than the underlying iterator of the specified rhs, and false otherwise. The behavior is undefined if comparing the underlying iterators in this way is undefined. Note that the functors are not compared.

operator<=

Return true if the underlying iterator of the specified lhs compares less than or equal to the underlying iterator of the specified rhs, and false otherwise. The behavior is undefined if comparing the underlying iterators in this way is undefined. Note that the functors are not compared.

operator==

Return true if the underlying iterator of the specified lhs compares equal to the underlying iterator of the specified rhs, and false otherwise. The behavior is undefined if comparing the underlying iterators in this way is undefined. Note that the functors are not compared.

operator>

Return true if the underlying iterator of the specified lhs compares greater than the underlying iterator of the specified rhs, and false otherwise. The behavior is undefined if comparing the underlying iterators in this way is undefined. Note that the functors are not compared.

operator>=

Return true if the underlying iterator of the specified lhs compares greater than or equal to the underlying iterator of the specified rhs, and false otherwise. The behavior is undefined if comparing the underlying iterators in this way is undefined. Note that the functors are not compared.

swap

Efficiently exchange the values of the specified a and b objects by applying swap to each of the functor and underlying iterator fields of the two objects.

Created with MrDocs