template<class T, class A = std::allocator<T*>>
class RWTPtrDlistIterator< T, A >
- Deprecated
- As of SourcePro 12.5, use RWTPtrDlist::iterator to iterate over the elements in this collection.
RWTPtrDlistIterator provides an iterator interface to the C++ Standard Library-based collection represented by RWTPtrDlist. (An STL iterator interface is provided through RWTPtrDlist::iterator.)
The order of iteration over an RWTPtrDlist is dependent on the order of the values in the container.
The current item referenced by this iterator is undefined after construction or after a call to reset(). The iterator becomes valid after being advanced with either pre-increment or operator()
.
For both operator++
and operator()
, iterating past the last element returns a value equivalent to boolean false
. Continued increments return a value equivalent to false
until reset() is called. For operator–
, decrementing past the first element returns a value equivalent to false
.
- Synopsis
#include <rw/tpdlist.h>
Deprecated. Provides an iterator for RWTPtrDlist.
Definition tpdlist.h:1404
A pointer-based collection of values, implemented as a doubly-linked list.
Definition tpdlist.h:155
- Persistence
- None
- Example
#include <rw/cstring.h>
#include <rw/tpdlist.h>
#include <iostream>
int main() {
while (itr()) {
std::cout << *itr.key() << std::endl;
}
return 0;
}
Offers powerful and convenient facilities for manipulating strings.
Definition stdcstring.h:826
bool insert(value_type a)
Definition tpdlist.h:571
void clearAndDestroy()
Definition tpdlist.h:830
Program Output:
template<class T , class A = std::allocator<T*>>
Advances self to the next element. If the iterator has been reset or just created, self will reference the first element. If, before iteration, self referenced the last value in the list, self will now reference an undefined value distinct from the reset value, and a value equivalent to false
will be returned. Otherwise, a value equivalent to true
is returned.
template<class T , class A = std::allocator<T*>>
Moves self back to the immediately previous element. If the iterator has been reset or just created, this operator returns a value equivalent to false
, otherwise it returns a value equivalent to true
. If self references the first element, it will now be in the reset state. If self has been iterated past the last value in the list, it will now reference the last item in the list.
template<class T , class A = std::allocator<T*>>
Returns and removes the first element t
, encountered by iterating self forward, such that the expression ((*fn)(t,d))
is true
. Client data may be passed through parameter d. If no such element exists, returns rwnil.