template<class T, class A = std::allocator<T>>
class RWTValDlistIterator< T, A >
- Deprecated
- As of SourcePro 12.5, use RWTValDlist::iterator to iterate over the elements in this collection.
RWTValDlistIterator provides an iterator interface to the C++ Standard Library-based collection represented by RWTValDlist. (An STL iterator interface is provided through RWTValDlist::iterator.)
The order of iteration over an RWTValDlist is dependent on the order of insertion of the values into 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 a pre-increment or operator()().
For both operator++() and operator()(), iterating past the last element returns a value equivalent to false
. Continued increments return a value equal to false
until reset() is called.
- Synopsis
#include <rw/tvdlist.h>
Deprecated. Provides an iterator for RWTValDlist.
Definition tvdlist.h:1375
Maintains a collection of values implemented as a doubly-linked list.
Definition tvdlist.h:142
- Persistence
- None
- Example
#include <rw/cstring.h>
#include <rw/tvdlist.h>
#include <iostream>
int main() {
while (itr()) {
std::cout << itr.key() << std::endl;
}
return 0;
}
bool insert(const value_type &a)
Definition tvdlist.h:463
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 false
is returned. Otherwise, returns true
.
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 false
, otherwise it returns 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>>
Removes the first element t
, encountered by iterating self forward, such that the expression ((*fn)(t,d))
is true
. Returns true
if an element was found and removed, otherwise returns false
. Client data may be passed through parameter d.