This value-semantic class represents a random access iterator providing non-modifiable access to the elements of a CompactedArray. This class provides all functionality of a random access iterator, as defined by the standard, but is not compatible with most standard methods requiring a bidirectional const_iterator.
Declared in <bdlc_compactedarray.h>
template<class TYPE>
class CompactedArray_ConstIterator;
This class does not perform any bounds checking. Any iterator, it, referencing a CompactedArray array, remains valid while 0 <= it - array.begin() < array.length().
| Name | Description |
|---|---|
difference_type | Signed type used for distances between iterators. |
iterator_category | Tag identifying this type as a random-access iterator. |
pointer | Pointer into the array (unused; always TYPE *). |
reference | Reference to an element (unused; always TYPE&). |
size_type | Unsigned type used for lengths and indices. |
value_type | Element type of the referenced array. |
| Name | Description |
|---|---|
CompactedArray_ConstIterator [constructor] | Constructors |
operator= | Assign to this iterator the value of the specified rhs iterator, and return a reference providing modifiable access to this iterator. |
operator* | Return a const reference to the element referenced by this iterator. The behavior is undefined unless for this iterator, referencing a CompactedArray array, CompactedArray_ConstIterator() != *this and *this - array.begin() < array.length(). |
operator++ | Advance this iterator to refer to the next location in the referenced array, and return a reference to this iterator after the advancement. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless, on entry, CompactedArray_ConstIterator() != *this and *this - array.begin() < array.length(). |
operator+= | Advance this iterator by the specified offset from the location referenced by this iterator, and return a reference providing modifiable access to this iterator. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless CompactedArray_ConstIterator() != *this and 0 <= *this - array.begin() + offset <= array.length(). |
operator-- | Decrement this iterator to refer to the previous location in the referenced array, and return a reference to this iterator after the decrementation. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless, on entry, CompactedArray_ConstIterator() != *this and 0 < *this - array.begin(). |
operator-= | Decrement this iterator by the specified offset from the location referenced by this iterator, and return a reference providing modifiable access to this iterator. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless CompactedArray_ConstIterator() != *this and 0 <= *this - array.begin() - offset <= array.length(). |
operator-> | Return a const reference to the element referenced by this iterator. The behavior is undefined unless for this iterator, referencing a CompactedArray array, CompactedArray_ConstIterator() != *this and *this - array.begin() < array.length(). |
operator[] | Return a const reference to the element at the specified offset from the location referenced by this iterator. The behavior is undefined unless for this iterator, referencing a CompactedArray array, CompactedArray_ConstIterator() != *this and 0 <= *this - array.begin() + offset < array.length(). |
| Name | Description |
|---|---|
BloombergLP::bdlc::operator>= | Return whether the left iterator follows or equals the right (see free operator>=). |
BloombergLP::bdlc::operator> | Return whether the left iterator follows the right (see free operator>). |
BloombergLP::bdlc::operator<= | Return whether the left iterator precedes or equals the right (see free operator<=). |
BloombergLP::bdlc::operator< | Return whether the left iterator precedes the right (see free operator<). |
BloombergLP::bdlc::operator- | Return the signed distance between two iterators (see free operator-). |
BloombergLP::bdlc::operator- | Return an iterator at the negated specified offset from the given iterator (see free operator-). |
BloombergLP::bdlc::operator+<> | Return an iterator at the specified offset from the given iterator (see free operator+). |
BloombergLP::bdlc::operator!= | Return whether the iterators refer to different positions (see free operator!=). |
BloombergLP::bdlc::operator== | Return whether the iterators refer to the same position (see free operator==). |
BloombergLP::bdlc::operator-- | Decrement iterator and return its prior value (see free operator--). |
BloombergLP::bdlc::operator++ | Advance iterator and return its prior value (see free operator++). |
BloombergLP::bdlc::CompactedArray | This space-efficient, value-semantic array class represents a sequence of TYPE elements. The interface provides functionality similar to a vector<TYPE>, however, modifiable references to individual elements are not provided. This class provides accessors that return iterators that provide non-modifiable access to its elements. The returned iterators, unlike those returned by a vector<TYPE>, are not invalidated upon reallocation. |
| Name | Description |
|---|---|
operator!= | Return true if the specified lhs and rhs iterators do not have the same value, and false otherwise. Two CompactedArray_ConstIterator iterators do not have the same value if one has the default value and the other does not, or neither has the default value and they do not reference the same location in the same array. |
operator+ | Same as the preceding overload with operands swapped. |
operator+ | Return an iterator referencing the location at the specified offset from the location referenced by the specified iterator. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless CompactedArray_ConstIterator() != iterator and 0 <= iterator - array.begin() + offset <= array.length(). |
operator++ | Advance the specified iterator to refer to the next location in the referenced array, and return an iterator referring to the original location (before the advancement). The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless, on entry, CompactedArray_ConstIterator() != iterator and iterator - array.begin() < array.length(). |
operator- | Return an iterator referencing the location at the specified offset from the location referenced by the specified iterator. The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless CompactedArray_ConstIterator() != iterator and 0 <= iterator - array.begin() - offset <= array.length(). |
operator- | Return the number of elements between the specified lhs and rhs as a signed value. The behavior is undefined unless lhs and rhs reference the same array. Note that the return value is positive when a positive number of rhs++ invocations would result in lhs == rhs, and negative when a positive number of rhs-- invocations would result in lhs == rhs. |
operator-- | Decrement the specified iterator to refer to the previous location in the referenced array, and return an iterator referring to the original location (before the decrementation). The returned iterator, it, referencing a CompactedArray array, remains valid as long as 0 <= it - array.begin() <= array.length(). The behavior is undefined unless, on entry, CompactedArray_ConstIterator() != iterator and 0 < iterator - array.begin(). |
operator< | Return true if the specified lhs has a value less than the specified rhs, and false otherwise. Iterator lhs has a value less than iterator rhs if 0 < rhs - lhs (see operator-). The behavior is undefined unless lhs and rhs refer to the same array. |
operator<= | Return true if the specified lhs has a value less than or equal to the specified rhs, and false' otherwise. Iterator lhs has a value less than or equal to iterator rhs if 0 <= rhs - lhs (see operator-). The behavior is undefined unless lhs and rhs refer to the same array. |
operator== | Return true if the specified lhs and rhs iterators have the same value, and false otherwise. Two CompactedArray_ConstIterator iterators have the same value if they both have the default value, or neither has the default value and they reference the same location in the same array. |
operator> | Return true if the specified lhs has a value greater than the specified rhs, and false otherwise. Iterator lhs has a value greater than iterator rhs if 0 > rhs - lhs (see operator-). The behavior is undefined unless lhs and rhs refer to the same array. |
operator>= | Return true if the specified lhs has a value greater or equal than the specified rhs, and false otherwise. Iterator lhs has a value greater than or equal to iterator rhs if 0 >= rhs - lhs (see operator-). The behavior is undefined unless lhs and rhs refer to the same array. |