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) `
Synopsis
Declared in <bslstl_randomaccessiterator.h>
template<
class T,
class ITER_IMP,
class TAG_TYPE = std::random_access_iterator_tag>
class RandomAccessIterator
: public BidirectionalIterator<T, ITER_IMP, TAG_TYPE>
Base Classes
Name |
Description |
Given an |
Type Aliases
Name |
Description |
Signed integer type measuring iterator distance. |
|
Random‐access iterator category tag. |
|
Pointer type for the iterator's value type. |
|
Reference type for the iterator's value type. |
|
Value type referred to by this iterator. |
Member Functions
Name |
Description |
|
Constructors |
Assignment operators |
|
|
|
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. |
|
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. |
|
Increment by the specified |
|
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. |
|
Decrement by the specified |
|
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. |
|
Return a reference to the element at the specified |
Non-Member Functions
Name |
Description |
Return |
|
Return |
|
Return |
|
Return an iterator to the element at the specified |
|
Return an iterator to the element at the specified |
|
Increment the specified |
|
Increment the specified |
|
Increment the specified |
|
Return an iterator to the element at the specified |
|
Return the distance from the specified |
|
Decrement the specified |
|
Decrement the specified |
|
Return |
|
Return |
|
Return |
|
Return |
|
Return |
|
Return |
|
Return |
Created with MrDocs