C++ Extensions (cppx) Documentation Internal Version
Main | Namespaces | Classes | NamespaceMembers | ClassMembers | Files

stdx::IndirectItr Class Template Reference

template<class I>
class stdx::IndirectItr< I >

Often we want to iterate through a container of pointers, but we want it to appear like we are iterating through a container of references to the objects the original pointers pointed to. We can do this with a new iterator which adds an extra dereference. This allows the following code to work:

 list<int*> lst;
 // ... fill the lst with pointers to ints ...
 copy( indirect_iseq(lst), ostream_iterator<int>(cout) );

Notice that because we are using indirect iterators, the actual ints are copied to the output iterator, not the pointers to the ints.

List of all members.

Public Types

Public Methods

Detailed Documentation

Member Typedef Documentation

template<class I>
typedef I stdx::IndirectItr::base_iterator
 

template<class I>
typedef std::iterator_traits<I>::iterator_category stdx::IndirectItr::iterator_category
 

template<class I>
typedef std::iterator_traits< typename std::iterator_traits<I>::value_type>::value_type stdx::IndirectItr::value_type
 

template<class I>
typedef std::iterator_traits<I>::difference_type stdx::IndirectItr::difference_type
 

template<class I>
typedef std::iterator_traits< typename std::iterator_traits<I>::value_type>::pointer stdx::IndirectItr::pointer
 

template<class I>
typedef std::iterator_traits< typename std::iterator_traits<I>::value_type>::reference stdx::IndirectItr::reference
 

Constructor & Destructor Documentation

template<class I>
stdx::IndirectItr< I >::IndirectItr  
 

Default indirect iterator constructor which creates an end-of-container marker.

template<class I>
stdx::IndirectItr< I >::IndirectItr   baseItr [explicit]
 

Primary indirect iterator constructor which creates a new indirector iterator wrapped around the given base iterator.

Member Function Documentation

template<class I>
reference stdx::IndirectItr< I >::operator *   const
 

template<class I>
pointer stdx::IndirectItr< I >::operator->   const
 

template<class I>
reference stdx::IndirectItr< I >::operator[] difference_type    n const
 

template<class I>
IndirectItr<I> stdx::IndirectItr< I >::operator+ difference_type    n const
 

template<class I>
IndirectItr<I>& stdx::IndirectItr< I >::operator+= difference_type    n
 

template<class I>
IndirectItr<I> stdx::IndirectItr< I >::operator- difference_type    n const
 

template<class I>
IndirectItr<I>& stdx::IndirectItr< I >::operator-= difference_type    n
 

template<class I>
IndirectItr<I> stdx::IndirectItr< I >::operator++ int   
 

template<class I>
IndirectItr<I>& stdx::IndirectItr< I >::operator++  
 

template<class I>
IndirectItr<I> stdx::IndirectItr< I >::operator-- int   
 

template<class I>
IndirectItr<I>& stdx::IndirectItr< I >::operator--  
 

template<class I>
I stdx::IndirectItr< I >::base   const
 



The documentation for this class was generated from the following file:
Generated on Mon Aug 15 21:43:10 2005 by Doxygen 1.2.13-20020210 written by Dimitri van Heesch © 1997-2002