BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE > Class Template Reference

#include <bslstl_forwarditerator.h>

Inheritance diagram for bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >:
bslstl::BidirectionalIterator< T, ITER_IMP, std::random_access_iterator_tag > bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE > bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >

Public Types

typedef UnCvqT value_type
 
typedef std::ptrdiff_t difference_type
 
typedef T * pointer
 
typedef T & reference
 
typedef std::forward_iterator_tag iterator_category
 

Public Member Functions

 ForwardIterator ()
 
 ForwardIterator (const ITER_IMP &implementation)
 
 ForwardIterator (const ForwardIterator &original)
 
 ForwardIterator (const ForwardNonConstIterator &other)
 
 ~ForwardIterator ()
 
ForwardIteratoroperator= (const ForwardIterator &rhs)
 
ForwardIteratoroperator= (const ForwardNonConstIterator &rhs)
 
ForwardIteratoroperator++ ()
 
ITER_IMP & imp ()
 Return a modifiable reference to the implementation object.
 
T & operator* () const
 
T * operator-> () const
 
const ITER_IMP & imp () const
 Return a non-modifiable reference to the implementation object.
 

Detailed Description

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

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)

Member Typedef Documentation

◆ difference_type

template<class T , class ITER_IMP , class TAG_TYPE = std::forward_iterator_tag>
typedef std::ptrdiff_t bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::difference_type

◆ iterator_category

template<class T , class ITER_IMP , class TAG_TYPE = std::forward_iterator_tag>
typedef std::forward_iterator_tag bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::iterator_category

◆ pointer

template<class T , class ITER_IMP , class TAG_TYPE = std::forward_iterator_tag>
typedef T* bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::pointer

◆ reference

template<class T , class ITER_IMP , class TAG_TYPE = std::forward_iterator_tag>
typedef T& bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::reference

◆ value_type

template<class T , class ITER_IMP , class TAG_TYPE = std::forward_iterator_tag>
typedef UnCvqT bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::value_type

Constructor & Destructor Documentation

◆ ForwardIterator() [1/4]

template<class T , class ITER_IMP , class TAG_TYPE >
bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::ForwardIterator ( )
inline

Construct the default value for this iterator type. All default- constructed ForwardIterator objects represent non-dereferenceable iterators into the same empty range. They do not have a singular value unless an object of the type specified by the template parameter ITER_IMP has a singular value after value-initialization.

◆ ForwardIterator() [2/4]

template<class T , class ITER_IMP , class TAG_TYPE >
bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::ForwardIterator ( const ITER_IMP &  implementation)
inline

Construct a forward iterator having the specified implementation of the parameterized ITER_IMP type.

◆ ForwardIterator() [3/4]

template<class T , class ITER_IMP , class TAG_TYPE = std::forward_iterator_tag>
bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::ForwardIterator ( const ForwardIterator< T, ITER_IMP, TAG_TYPE > &  original)

Create a ForwardIterator having the same value as the specified original iterator. Note that this method's definition is compiler generated.

◆ ForwardIterator() [4/4]

template<class T , class ITER_IMP , class TAG_TYPE >
bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::ForwardIterator ( const ForwardNonConstIterator other)
inline

Construct a forward iterator from the specified other iterator of another (compatible) ForwardIterator type, e.g., a mutable iterator of the same type. Note that this constructor may be the copy constructor (inhibiting the implicit declaration of a copy constructor above), or may be an additional overload.

◆ ~ForwardIterator()

template<class T , class ITER_IMP , class TAG_TYPE = std::forward_iterator_tag>
bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::~ForwardIterator ( )

Destroy this iterator. Note that this method's definition is compiler generated.

Member Function Documentation

◆ imp() [1/2]

template<class T , class ITER_IMP , class TAG_TYPE >
ITER_IMP & bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::imp ( )
inline

◆ imp() [2/2]

template<class T , class ITER_IMP , class TAG_TYPE >
const ITER_IMP & bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::imp ( ) const
inline

◆ operator*()

template<class T , class ITER_IMP , class TAG_TYPE >
T & bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::operator* ( ) const
inline

Return a reference to the current, modifiable element. The behavior is undefined if this iterator has the past-the-end value for an iterator over the underlying sequence.

◆ operator++()

template<class T , class ITER_IMP , class TAG_TYPE >
ForwardIterator< T, ITER_IMP, TAG_TYPE > & bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::operator++ ( )
inline

Increment to the next element. Return a reference to this modifiable iterator. The behavior is undefined if, on entry, this iterator has the past-the-end value for an iterator over the underlying sequence.

◆ operator->()

template<class T , class ITER_IMP , class TAG_TYPE >
T * bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::operator-> ( ) const
inline

Return a pointer to the current, modifiable element. The behavior is undefined if this iterator has the past-the-end value for an iterator over the underlying sequence.

◆ operator=() [1/2]

template<class T , class ITER_IMP , class TAG_TYPE = std::forward_iterator_tag>
ForwardIterator & bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::operator= ( const ForwardIterator< T, ITER_IMP, TAG_TYPE > &  rhs)

Copy the value of the specified rhs to this iterator. Return a reference to this modifiable object. Note that this method's definition is compiler generated.

◆ operator=() [2/2]

template<class T , class ITER_IMP , class TAG_TYPE >
ForwardIterator< T, ITER_IMP, TAG_TYPE > & bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::operator= ( const ForwardNonConstIterator rhs)
inline

Copy the value of the specified rhs of another (compatible) ForwardIterator type, (e.g., a mutable iterator of the same type) to this iterator. Return a reference to this modifiable object. Note that this method may be the copy-assignment operator (inhibiting the implicit declaration of a copy-assignment operator above), or may be an additional overload.


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