Quick Links: |
#include <bdlc_packedintarray.h>
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.
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()
.
See Component bdlc_packedintarray
typedef bsl::ptrdiff_t bdlc::PackedIntArrayConstIterator< TYPE >::difference_type |
The type
typedef bsl::size_t bdlc::PackedIntArrayConstIterator< TYPE >::size_type |
The type
typedef TYPE bdlc::PackedIntArrayConstIterator< TYPE >::value_type |
The type for
typedef void* bdlc::PackedIntArrayConstIterator< TYPE >::pointer |
The type of
typedef TYPE& bdlc::PackedIntArrayConstIterator< TYPE >::reference |
The type for
bdlc::PackedIntArrayConstIterator< TYPE >::PackedIntArrayConstIterator | ( | ) |
Create a default PackedIntArrayConstIterator
. Note that the use of most methods - as indicated in their documentation - upon this iterator will result in undefined behavior.
bdlc::PackedIntArrayConstIterator< TYPE >::PackedIntArrayConstIterator | ( | const PackedIntArrayConstIterator< TYPE > & | original | ) |
Create a PackedIntArrayConstIterator
having the same value as the specified original
one.
bdlc::PackedIntArrayConstIterator< TYPE >::~PackedIntArrayConstIterator | ( | ) |
Destroy this object.
PackedIntArrayConstIterator& bdlc::PackedIntArrayConstIterator< TYPE >::operator= | ( | const PackedIntArrayConstIterator< TYPE > & | rhs | ) |
Assign to this iterator the value of the specified rhs
iterator, and return a reference providing modifiable access to this iterator.
PackedIntArrayConstIterator& bdlc::PackedIntArrayConstIterator< TYPE >::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()
.
PackedIntArrayConstIterator& bdlc::PackedIntArrayConstIterator< TYPE >::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()
.
PackedIntArrayConstIterator& bdlc::PackedIntArrayConstIterator< TYPE >::operator+= | ( | bsl::ptrdiff_t | offset | ) |
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()
.
PackedIntArrayConstIterator& bdlc::PackedIntArrayConstIterator< TYPE >::operator-= | ( | bsl::ptrdiff_t | offset | ) |
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()
.
TYPE bdlc::PackedIntArrayConstIterator< TYPE >::operator* | ( | ) | const |
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()
.
TYPE bdlc::PackedIntArrayConstIterator< TYPE >::operator-> | ( | ) | const |
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()
.
TYPE bdlc::PackedIntArrayConstIterator< TYPE >::operator[] | ( | bsl::ptrdiff_t | offset | ) | const |
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()
.
PackedIntArrayConstIterator bdlc::PackedIntArrayConstIterator< TYPE >::operator+ | ( | bsl::ptrdiff_t | offset | ) | const |
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()
.
PackedIntArrayConstIterator bdlc::PackedIntArrayConstIterator< TYPE >::operator- | ( | bsl::ptrdiff_t | offset | ) | const |
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()
.
friend class PackedIntArray< TYPE > [friend] |
PackedIntArrayConstIterator operator++ | ( | PackedIntArrayConstIterator< TYPE > & | , | |
int | ||||
) | [friend] |
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()
.
PackedIntArrayConstIterator operator-- | ( | PackedIntArrayConstIterator< TYPE > & | , | |
int | ||||
) | [friend] |
Decrement the specified iterator iter
to refer to the previous element in the referenced array, and return an iterator referring to the original element (before 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, PackedIntArrayConstInterator() != iter
and 0 < iter - array.begin()
.
bool operator== | ( | const PackedIntArrayConstIterator< TYPE > & | , | |
const PackedIntArrayConstIterator< TYPE > & | ||||
) | [friend] |
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.
bool operator!= | ( | const PackedIntArrayConstIterator< TYPE > & | , | |
const PackedIntArrayConstIterator< TYPE > & | ||||
) | [friend] |
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.
bsl::ptrdiff_t operator- | ( | const PackedIntArrayConstIterator< TYPE > & | , | |
const PackedIntArrayConstIterator< TYPE > & | ||||
) | [friend] |
Return the number of elements between specified lhs
and rhs
. The behavior is undefined unless lhs
and rhs
reference the same array.
bool operator< | ( | const PackedIntArrayConstIterator< TYPE > & | , | |
const PackedIntArrayConstIterator< TYPE > & | ||||
) | [friend] |
Return true
if the specified lhs
has a value less than the specified rhs
, false
otherwise. An iterator has a value less than another if its index is less the other's index. The behavior is undefined unless lhs
and rhs
refer to the same array.
bool operator<= | ( | const PackedIntArrayConstIterator< TYPE > & | , | |
const PackedIntArrayConstIterator< TYPE > & | ||||
) | [friend] |
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.
bool operator> | ( | const PackedIntArrayConstIterator< TYPE > & | , | |
const PackedIntArrayConstIterator< TYPE > & | ||||
) | [friend] |
Return true
if the specified lhs
has a value greater than the specified rhs
, false
otherwise. An iterator has a value greater than another if its index is greater the other's index. The behavior is undefined unless lhs
and rhs
refer to the same array.
bool operator>= | ( | const PackedIntArrayConstIterator< TYPE > & | , | |
const PackedIntArrayConstIterator< TYPE > & | ||||
) | [friend] |
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.