|
Nugget
|
#include <EASTLTest.h>
Public Types | |
| typedef demoted_iterator< Iterator, IteratorCategory > | this_type |
| typedef Iterator | iterator_type |
| typedef IteratorCategory | iterator_category |
| typedef eastl::iterator_traits< Iterator >::value_type | value_type |
| typedef eastl::iterator_traits< Iterator >::difference_type | difference_type |
| typedef eastl::iterator_traits< Iterator >::reference | reference |
| typedef eastl::iterator_traits< Iterator >::pointer | pointer |
Public Member Functions | |
| demoted_iterator (const Iterator &i) | |
| demoted_iterator (const this_type &x) | |
| this_type & | operator= (const Iterator &i) |
| this_type & | operator= (const this_type &x) |
| reference | operator* () const |
| pointer | operator-> () const |
| this_type & | operator++ () |
| this_type | operator++ (int) |
| this_type & | operator-- () |
| this_type | operator-- (int) |
| reference | operator[] (const difference_type &n) const |
| this_type & | operator+= (const difference_type &n) |
| this_type | operator+ (const difference_type &n) const |
| this_type & | operator-= (const difference_type &n) |
| this_type | operator- (const difference_type &n) const |
| const iterator_type & | base () const |
Protected Attributes | |
| Iterator | mIterator |
Converts an iterator into a demoted category. For example, you can convert an iterator of type bidirectional_iterator_tag to forward_iterator_tag. The following is a list of iterator types. A demonted iterator can be demoted only to a lower iterator category (earlier in the following list): input_iterator_tag forward_iterator_tag bidirectional_iterator_tag random_access_iterator_tag contiguous_iterator_tag
Converts something which can be iterated into a formal input iterator. This class is useful for testing functions and algorithms that expect InputIterators, which are the lowest and 'weakest' form of iterators.
Key traits of InputIterators: Algorithms on input iterators should never attempt to pass through the same iterator twice. They should be single pass algorithms. value_type T is not required to be an lvalue type.
Example usage: typedef demoted_iterator<int*, eastl::bidirectional_iterator_tag> PointerAsBidirectionalIterator; typedef demoted_iterator<MyVector::iterator, eastl::forward_iterator_tag> VectorIteratorAsForwardIterator;
Example usage: IntVector v; comb_sort(to_forward_iterator(v.begin()), to_forward_iterator(v.end()));