This reverse iterator adapter provides a subset of the bsl::reverse_iterator interface that can be used with the calendar iterators defined in bdlt. Specifically, the types value_type, difference_type, pointer, and reference are defined but iterator_category is not defined (since this is not a fully‐compliant iterator). Furthermore, the methods appropriate for random‐access iterators are not included (e.g., operator+=).

Synopsis

Declared in <bdlt_calendarreverseiteratoradapter.h>

template<class ITERATOR>
class CalendarReverseIteratorAdapter;

Type Aliases

Name

Description

difference_type

Iterator difference type.

pointer

Iterator pointer type.

reference

Iterator reference type.

value_type

Iterator value type.

Member Functions

Name

Description

CalendarReverseIteratorAdapter [constructor]

Constructors

~CalendarReverseIteratorAdapter [destructor]

Destroy this object.

operator=

Assignment operators

forwardIterator

Return the forward iterator referring to the element in the forward sequence after the element referred to by this reverse iterator.

operator*

Return a reference to the element referred to by this reverse iterator. The behavior is undefined unless this iterator is within the bounds of the underlying sequence.

operator++

Modify this reverse iterator to refer to the next element in the reverse iteration sequence, and return a reference providing modifiable access to this reverse iterator. The behavior is undefined unless, on entry, this reverse iterator does not have the past‐the‐end value for a reverse iterator over the underlying sequence.

operator‐‐

Modify this reverse iterator to refer to the previous element in the reverse iteration sequence, and return a reference providing modifiable access to this reverse iterator. The behavior is undefined unless, on entry, this reverse iterator does not have the same value as a reverse iterator at the start of the underlying sequence.

operator‐>

Return a pointer to the element referred to by this reverse iterator. The behavior is undefined unless this iterator is within the bounds of the underlying sequence.

Non-Member Functions

Name

Description

operator!=

Return true if the specified lhs reverse iterator does not have the same value as the specified rhs reverse iterator, and false otherwise. Two reverse iterators do not have the same value if (1) they do not refer to the same element and (2) both do not have the past‐the‐end value for a reverse iterator over the underlying reverse iteration sequence. The behavior is undefined unless lhs and rhs refer to the same underlying sequence.

operator++

Modify the specified iterator to refer to the next element in the reverse iteration sequence, and return a reverse iterator having the pre‐increment value of iterator. The behavior is undefined unless, on entry, iterator does not have the past‐the‐end value for a reverse iterator over the underlying sequence.

operator‐‐

Modify the specified iterator to refer to the previous element in the reverse iteration sequence, and return a reverse iterator having the pre‐decrement value of iterator. The behavior is undefined unless, on entry, iterator does not have the same value as a reverse iterator to the start of the underlying sequence.

operator==

Return true if the specified lhs reverse iterator has the same value as the specified rhs reverse iterator, and false otherwise. Two reverse iterators have the same value if they refer to the same element, or both have the past‐the‐end value for a reverse iterator over the underlying reverse iteration sequence. The behavior is undefined unless lhs and rhs refer to the same underlying sequence.

Created with MrDocs