[#BloombergLP-bdlc-PackedIntArrayConstIterator] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::PackedIntArrayConstIterator :relfileprefix: ../../ :mrdocs: This unconstrained (value‐semantic) class represents a random access iterator providing non‐modifiable access to the elements of a `PackedIntArray`. 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. == Synopsis Declared in `<bdlc_packedintarray.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> class PackedIntArrayConstIterator; ---- == Description This class does not perform any bounds checking. The returned iterator, `it`, referencing an element within a `PackedIntArray`, `array`, remains valid while `0 <= it ‐ array.begin() < array.length()`. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/difference_type.adoc[`difference_type`] | Iterator difference type. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/pointer.adoc[`pointer`] | Iterator pointer type. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/reference.adoc[`reference`] | Iterator reference type. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/size_type.adoc[`size_type`] | Iterator size type. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/value_type.adoc[`value_type`] | Iterator value type. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/2constructor-00.adoc[`PackedIntArrayConstIterator`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_assign.adoc[`operator=`] | Assign to this iterator the value of the specified `rhs` iterator, and return a reference providing modifiable access to this iterator. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_star.adoc[`operator*`] | Return the element value referenced by this iterator. The behavior is undefined unless for this iterator, referencing an element within a `PackedIntArray` `array`, `PackedIntArrayConstInterator() != *this` and `*this ‐ array.begin() < array.length()`. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_plus.adoc[`operator+`] | Return an iterator referencing the location at the specified `offset` from the element referenced by this iterator. The returned iterator, `it`, referencing an element within a `PackedIntArray`, `array`, remains valid as long as `0 <= it ‐ array.begin() <= array.length()`. The behavior is undefined unless `0 <= *this ‐ array.begin() + offset <= array.length()`. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_inc.adoc[`operator++`] | Advance this iterator to refer to the next element in the referenced array and return a reference to this iterator _after_ the advancement. The returned iterator, `it`, referencing an element within a `PackedIntArray`, `array`, remains valid as long as `0 <= it ‐ array.begin() <= array.length()`. The behavior is undefined unless, on entry, `PackedIntArrayConstInterator() != *this` and `*this ‐ array.begin() < array.length()`. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_plus_eq.adoc[`operator+=`] | Advance this iterator by the specified `offset` from the element referenced to this iterator. The returned iterator, `it`, referencing an element within a `PackedIntArray`, `array`, remains valid as long as `0 <= it ‐ array.begin() <= array.length()`. The behavior is undefined unless `PackedIntArrayConstInterator() != *this` and `0 <= *this ‐ array.begin() + offset <= array.length()`. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_minus.adoc[`operator‐`] | Return an iterator referencing the location at the specified `offset` from the element referenced by this iterator. The returned iterator, `it`, referencing an element within a `PackedIntArray`, `array`, remains valid as long as `0 <= it ‐ array.begin() <= array.length()`. The behavior is undefined unless `PackedIntArrayConstInterator() != *this` and `0 <= *this ‐ array.begin() ‐ offset <= array.length()`. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_dec.adoc[`operator‐‐`] | Decrement this iterator to refer to the previous element in the referenced array and return a reference to this iterator _after_ the decrementation. The returned iterator, `it`, referencing an element within a `PackedIntArray`, `array`, remains valid as long as `0 <= it ‐ array.begin() <= array.length()`. The behavior is undefined unless, on entry, `0 < *this ‐ array.begin()`. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_minus_eq.adoc[`operator‐=`] | Decrement this iterator by the specified `offset` from the element referenced to this iterator. The returned iterator, `it`, referencing an element within a `PackedIntArray`, `array`, remains valid as long as `0 <= it ‐ array.begin() <= array.length()`. The behavior is undefined unless `PackedIntArrayConstInterator() != *this` and `0 <= *this ‐ array.begin() ‐ offset <= array.length()`. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_ptr.adoc[`operator‐>`] | Return the element value referenced by this iterator. The behavior is undefined unless for this iterator, referencing an element within a `PackedIntArray` `array`, `PackedIntArrayConstInterator() != *this` and `*this ‐ array.begin() < array.length()`. | xref:BloombergLP/bdlc/PackedIntArrayConstIterator/operator_subs.adoc[`operator[]`] | Return the element that is the specified `offset` from the element reference by this array. The behavior is undefined unless for this iterator, referencing an element within a `PackedIntArray` `array`, `PackedIntArrayConstInterator() != *this` and `0 <= *this ‐ array.begin() + offset < array.length()`. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bdlc/operator_ge-0e.adoc[BloombergLP::bdlc::operator>=<>]` | | `xref:BloombergLP/bdlc/operator_gt-0d.adoc[BloombergLP::bdlc::operator><>]` | | `xref:BloombergLP/bdlc/operator_le-08.adoc[BloombergLP::bdlc::operator<=<>]` | | `xref:BloombergLP/bdlc/operator_lt-02b.adoc[BloombergLP::bdlc::operator<<>]` | | `xref:BloombergLP/bdlc/operator_minus-05.adoc[BloombergLP::bdlc::operator‐<>]` | | `xref:BloombergLP/bdlc/operator_not_eq-0a.adoc[BloombergLP::bdlc::operator!=<>]` | | `xref:BloombergLP/bdlc/operator_eq-06.adoc[BloombergLP::bdlc::operator==<>]` | | `xref:BloombergLP/bdlc/operator_dec-0b.adoc[BloombergLP::bdlc::operator‐‐<>]` | | `xref:BloombergLP/bdlc/operator_inc-06.adoc[BloombergLP::bdlc::operator++<>]` | | `xref:BloombergLP/bdlc/PackedIntArray-0b.adoc[BloombergLP::bdlc::PackedIntArray]` | This space‐efficient value‐semantic array class represents a sequence of `TYPE` elements; `TYPE` must be convertible to either a signed or unsigned 64‐bit integer using `static_cast`. The interface provides functionality similar to a `vector<int>` however 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<int>` are _not_ invalidated upon reallocation. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/operator_not_eq-02.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` iterators do not have the same value and `false` otherwise. Two `PackedIntArrayConstIterator` iterators do not have the same value if they do not refer to the same array, or do not have the same index. | xref:BloombergLP/bdlc/operator_inc-01.adoc[`operator++`] | Advance the specified iterator `iter` to refer to the next element in the referenced array, and return an iterator referring to the original element (_before_ the advancement). The returned iterator, `it`, referencing an element within a `PackedIntArray`, `array`, remains valid as long as `0 <= it ‐ array.begin() <= array.length()`. The behavior is undefined unless, on entry, `PackedIntArrayConstInterator() != iter` and `iter ‐ array.begin() < array.length()`. | xref:BloombergLP/bdlc/operator_minus-09.adoc[`operator‐`] | Return the number of elements between specified `lhs` and `rhs`. The behavior is undefined unless `lhs` and `rhs` reference the same array. | xref:BloombergLP/bdlc/operator_dec-06.adoc[`operator‐‐`] | Post‐decrement the specified iterator `iter`. | xref:BloombergLP/bdlc/operator_lt-02e.adoc[`operator<`] | Return true if `lhs` precedes `rhs` in the referenced array. | xref:BloombergLP/bdlc/operator_le-06.adoc[`operator<=`] | Return `true` if the specified `lhs` has a value less than or equal to the specified `rhs, `false' otherwise. An iterator has a value less than or equal to another if its index is less or equal the other's index. The behavior is undefined unless `lhs` and `rhs` refer to the same array. | xref:BloombergLP/bdlc/operator_eq-0a.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` iterators have the same value, and `false` otherwise. Two `PackedIntArrayConstIterator` iterators have the same value if they refer to the same array, and have the same index. | xref:BloombergLP/bdlc/operator_gt-08.adoc[`operator>`] | Return true if `lhs` follows `rhs` in the referenced array. | xref:BloombergLP/bdlc/operator_ge-00.adoc[`operator>=`] | Return `true` if the specified `lhs` has a value greater or equal than the specified `rhs`, `false` otherwise. An iterator has a value greater than or equal to another if its index is greater the other's index. The behavior is undefined unless `lhs` and `rhs` refer to the same array. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#