BDE 4.14.0 Production release
|
#include <bdlc_compactedarray.h>
Public Types | |
typedef bsl::ptrdiff_t | difference_type |
typedef bsl::size_t | size_type |
typedef TYPE | value_type |
typedef TYPE * | pointer |
typedef TYPE & | reference |
typedef std::random_access_iterator_tag | iterator_category |
Public Member Functions | |
CompactedArray_ConstIterator () | |
CompactedArray_ConstIterator (const CompactedArray_ConstIterator &original) | |
~CompactedArray_ConstIterator ()=default | |
CompactedArray_ConstIterator & | operator= (const CompactedArray_ConstIterator &rhs) |
CompactedArray_ConstIterator & | operator+= (bsl::ptrdiff_t offset) |
CompactedArray_ConstIterator & | operator-= (bsl::ptrdiff_t offset) |
CompactedArray_ConstIterator & | operator++ () |
CompactedArray_ConstIterator & | operator-- () |
const TYPE & | operator* () const |
const TYPE & | operator-> () const |
const TYPE & | operator[] (bsl::ptrdiff_t offset) const |
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
.
This class does not perform any bounds checking. Any iterator, it
, referencing a CompactedArray
array
, remains valid while 0 <= it - array.begin() < array.length()
.
typedef bsl::ptrdiff_t bdlc::CompactedArray_ConstIterator< TYPE >::difference_type |
typedef std::random_access_iterator_tag bdlc::CompactedArray_ConstIterator< TYPE >::iterator_category |
typedef TYPE* bdlc::CompactedArray_ConstIterator< TYPE >::pointer |
typedef TYPE& bdlc::CompactedArray_ConstIterator< TYPE >::reference |
typedef bsl::size_t bdlc::CompactedArray_ConstIterator< TYPE >::size_type |
typedef TYPE bdlc::CompactedArray_ConstIterator< TYPE >::value_type |
|
inline |
Create a default CompactedArray_ConstIterator
. Note that the behavior of most methods is undefined when used on a default-constructed iterator.
|
inline |
Create a CompactedArray_ConstIterator
having the same value as the specified original
object.
|
default |
|
inline |
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()
.
|
inline |
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()
.
|
inline |
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()
.
|
inline |
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()
.
|
inline |
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()
.
|
inline |
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()
.
|
inline |
Assign to this iterator the value of the specified rhs
iterator, and return a reference providing modifiable access to this iterator.
|
inline |
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()
.
|
friend |
|
friend |
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.
|
friend |
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()
.
|
friend |
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()
.
|
friend |
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
.
|
friend |
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()
.
|
friend |
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()
.
|
friend |
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.
|
friend |
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.
|
friend |
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.
|
friend |
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.
|
friend |
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.