STL‐compliant forward iterator adapted from a minimal implementation.

Synopsis

Declared in <bslstl_forwarditerator.h>

template<
    class T,
    class ITER_IMP,
    class TAG_TYPE = std::forward_iterator_tag>
class ForwardIterator;

Description

Given an ITER_IMP type that implements a minimal subset of an iterator interface, this template generates a complete iterator that meets all of the requirements of a "forward iterator" in the C++ standard. If T is const‐qualified, then the resulting type is a const iterator. T shall not be a function, reference type or void. ITER_IMP must provide public operations so that, for objects i and j of type ITER_IMP, the following operations are supported: ` ITER_IMP i; Default construction ITER_IMP j(i); Copy construction i = j Assignment ++i Increment to next element i == j // convertible to bool Equality comparison *i // reference convertible to T& Element access (dereference) `

Type Aliases

Name

Description

difference_type

Iterator difference type.

iterator_category

Standard forward iterator category tag.

pointer

Pointer type for the iterator's value type.

reference

Reference type for the iterator's value type.

value_type

Value type for this iterator.

Member Functions

Name

Description

ForwardIterator [constructor]

Constructors

operator=

Assign to this iterator the value of a compatible iterator.

imp

imp overloads

operator*

Return a reference to the current element.

operator++

Advance this iterator to the next element.

operator‐>

Return a pointer to the current element.

Non-Member Functions

Name

Description

operator!=

Return true if lhs and rhs do not have the same value.

operator++

Advance iter to the next element and return its previous value.

operator==

Return true if lhs and rhs have the same value.

Derived Classes

Name

Description

BidirectionalIterator

Adaptor that produces a standard bidirectional iterator from a core type.

Created with MrDocs