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

#include <bslstl_randomaccessiterator.h>

Inheritance diagram for bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >:
bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE > bslstl::ForwardIterator< 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::random_access_iterator_tag iterator_category
 
- Public Types inherited from bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE >
typedef UnCvqT value_type
 
typedef std::ptrdiff_t difference_type
 
typedef T * pointer
 
typedef T & reference
 
typedef std::bidirectional_iterator_tag iterator_category
 
- Public Types inherited from bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >
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

 RandomAccessIterator ()
 
 RandomAccessIterator (const ITER_IMP &implementation)
 
 RandomAccessIterator (const RandomAccessIterator< UnCvqT, ITER_IMP, TAG_TYPE > &other)
 
 ~RandomAccessIterator ()
 
RandomAccessIteratoroperator= (const RandomAccessIterator< UnCvqT, ITER_IMP, TAG_TYPE > &other)
 
RandomAccessIteratoroperator++ ()
 
RandomAccessIteratoroperator-- ()
 
RandomAccessIteratoroperator+= (difference_type offset)
 
RandomAccessIteratoroperator-= (difference_type offset)
 
T & operator[] (difference_type index) const
 
- Public Member Functions inherited from bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE >
 BidirectionalIterator ()
 
 BidirectionalIterator (const ITER_IMP &implementation)
 
 BidirectionalIterator (const BidirectionalIterator &original)
 
 BidirectionalIterator (const BidirectionalNonConstIterator &other)
 
 ~BidirectionalIterator ()
 
BidirectionalIteratoroperator= (const BidirectionalIterator &rhs)
 
BidirectionalIteratoroperator= (const BidirectionalNonConstIterator &rhs)
 
BidirectionalIteratoroperator++ ()
 
BidirectionalIteratoroperator-- ()
 
- Public Member Functions inherited from bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >
 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::random_access_iterator_tag>
class bslstl::RandomAccessIterator< 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 "random-access 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 and n of an integral type, 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 decrement to previous element
i += n increment by n elements
i -= n decrement by n elements
j - i // convertible to ptrdiff_t distance from i to j
i == j // convertible to bool equality comparison
i < j // convertible to bool less-than comparison
*i // reference convertible to T& element access (dereference)

Member Typedef Documentation

◆ difference_type

template<class T , class ITER_IMP , class TAG_TYPE = std::random_access_iterator_tag>
typedef std::ptrdiff_t bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::difference_type

◆ iterator_category

template<class T , class ITER_IMP , class TAG_TYPE = std::random_access_iterator_tag>
typedef std::random_access_iterator_tag bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::iterator_category

◆ pointer

template<class T , class ITER_IMP , class TAG_TYPE = std::random_access_iterator_tag>
typedef T* bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::pointer

◆ reference

template<class T , class ITER_IMP , class TAG_TYPE = std::random_access_iterator_tag>
typedef T& bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::reference

◆ value_type

template<class T , class ITER_IMP , class TAG_TYPE = std::random_access_iterator_tag>
typedef UnCvqT bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::value_type

Constructor & Destructor Documentation

◆ RandomAccessIterator() [1/3]

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

Construct the default value for this iterator type. All default- constructed RandomAccessIterator 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.

◆ RandomAccessIterator() [2/3]

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

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

◆ RandomAccessIterator() [3/3]

template<class T , class ITER_IMP , class TAG_TYPE >
bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::RandomAccessIterator ( const RandomAccessIterator< UnCvqT, ITER_IMP, TAG_TYPE > &  other)
inline

Construct a random access iterator from another (compatible) RandomAccessIterator 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.

◆ ~RandomAccessIterator()

template<class T , class ITER_IMP , class TAG_TYPE = std::random_access_iterator_tag>
bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::~RandomAccessIterator ( )

Member Function Documentation

◆ operator++()

template<class T , class ITER_IMP , class TAG_TYPE >
RandomAccessIterator< T, ITER_IMP, TAG_TYPE > & bslstl::RandomAccessIterator< 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 >
RandomAccessIterator< T, ITER_IMP, TAG_TYPE > & bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator+= ( difference_type  offset)
inline

Increment by the specified offset number of elements. Return a reference to this modifiable iterator. The behavior is undefined unless the iterator, after incrementing by offset, is within the bounds of the underlying sequence.

◆ operator--()

template<class T , class ITER_IMP , class TAG_TYPE >
RandomAccessIterator< T, ITER_IMP, TAG_TYPE > & bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator-- ( )
inline

Decrement to the previous element. Return a reference to this modifiable iterator. The behavior is undefined if, on entry, this iterator has the same value as an iterator to the start of the underlying sequence.

◆ operator-=()

template<class T , class ITER_IMP , class TAG_TYPE >
RandomAccessIterator< T, ITER_IMP, TAG_TYPE > & bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator-= ( difference_type  offset)
inline

Decrement by the specified offset number of elements. Return a reference to this modifiable iterator. The behavior is undefined unless the iterator, after decrementing by offset, is within the bounds of the underlying sequence.

◆ operator=()

template<class T , class ITER_IMP , class TAG_TYPE >
RandomAccessIterator< T, ITER_IMP, TAG_TYPE > & bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator= ( const RandomAccessIterator< UnCvqT, ITER_IMP, TAG_TYPE > &  other)
inline

Copy the value of the specified rhs to this iterator. Return a reference to this modifiable iterator.

◆ operator[]()

template<class T , class ITER_IMP , class TAG_TYPE >
T & bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator[] ( difference_type  index) const
inline

Return a reference to the element at the specified index positions past the current one. The behavior is undefined unless the referenced position lies within the underlying sequence. Note that index may be negative.


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