Nugget
Public Types | Public Member Functions | Protected Attributes | List of all members
demoted_iterator< Iterator, IteratorCategory > Class Template Reference

#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_typeoperator= (const Iterator &i)
 
this_typeoperator= (const this_type &x)
 
reference operator* () const
 
pointer operator-> () const
 
this_typeoperator++ ()
 
this_type operator++ (int)
 
this_typeoperator-- ()
 
this_type operator-- (int)
 
reference operator[] (const difference_type &n) const
 
this_typeoperator+= (const difference_type &n)
 
this_type operator+ (const difference_type &n) const
 
this_typeoperator-= (const difference_type &n)
 
this_type operator- (const difference_type &n) const
 
const iterator_type & base () const
 

Protected Attributes

Iterator mIterator
 

Detailed Description

template<typename Iterator, typename IteratorCategory>
class demoted_iterator< Iterator, IteratorCategory >

demoted_iterator

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()));


The documentation for this class was generated from the following file: