Quick Links: |
#include <bslstl_randomaccessiterator.h>
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 Member Functions | |
RandomAccessIterator () | |
RandomAccessIterator (const ITER_IMP &implementation) | |
RandomAccessIterator (const RandomAccessIterator< UnCvqT, ITER_IMP, TAG_TYPE > &other) | |
~RandomAccessIterator () | |
RandomAccessIterator & | operator= (const RandomAccessIterator< UnCvqT, ITER_IMP, TAG_TYPE > &other) |
RandomAccessIterator & | operator++ () |
RandomAccessIterator & | operator-- () |
RandomAccessIterator & | operator+= (difference_type offset) |
RandomAccessIterator & | operator-= (difference_type offset) |
T & | operator[] (difference_type index) const |
ITER_IMP & | imp () |
const ITER_IMP & | imp () const |
T & | operator* () const |
T * | operator-> () const |
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)
See Component bslstl_randomaccessiterator
typedef UnCvqT bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::value_type |
Reimplemented from bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE >.
typedef std::ptrdiff_t bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::difference_type |
Reimplemented from bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE >.
typedef T* bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::pointer |
Reimplemented from bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE >.
typedef T& bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::reference |
Reimplemented from bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE >.
typedef std::random_access_iterator_tag bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::iterator_category |
Reimplemented from bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE >.
bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::RandomAccessIterator | ( | ) |
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.
bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::RandomAccessIterator | ( | const ITER_IMP & | implementation | ) |
IMPLICIT: Construct a random access iterator having the specified implementation
of the parameterized ITER_IMP
type.
bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::RandomAccessIterator | ( | const RandomAccessIterator< UnCvqT, ITER_IMP, TAG_TYPE > & | other | ) |
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.
bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::~RandomAccessIterator | ( | ) |
Destroy this iterator. Note that this method's definition is compiler generated.
RandomAccessIterator& bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator= | ( | const RandomAccessIterator< UnCvqT, ITER_IMP, TAG_TYPE > & | other | ) |
Copy the value of the specified rhs
to this iterator. Return a reference to this modifiable iterator.
RandomAccessIterator& bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator++ | ( | ) |
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.
Reimplemented from bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE >.
RandomAccessIterator& bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator-- | ( | ) |
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.
Reimplemented from bslstl::BidirectionalIterator< T, ITER_IMP, TAG_TYPE >.
RandomAccessIterator& bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator+= | ( | difference_type | offset | ) |
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.
RandomAccessIterator& bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator-= | ( | difference_type | offset | ) |
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.
T& bslstl::RandomAccessIterator< T, ITER_IMP, TAG_TYPE >::operator[] | ( | difference_type | index | ) | const |
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.
ITER_IMP& bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::imp | ( | ) | [inherited] |
Return a modifiable reference to the implementation object.
const ITER_IMP& bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::imp | ( | ) | const [inherited] |
Return a non-modifiable reference to the implementation object.
T& bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::operator* | ( | ) | const [inherited] |
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.
T* bslstl::ForwardIterator< T, ITER_IMP, TAG_TYPE >::operator-> | ( | ) | const [inherited] |
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.