Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Struct template iterator

boost::type_erasure::iterator

Synopsis

// In header: <boost/type_erasure/iterator.hpp>

template<typename Traversal, typename T = _self, 
         typename Reference = ::boost::use_default, 
         typename DifferenceType = ::std::ptrdiff_t, 
         typename ValueType = typename deduced<iterator_value_type<T> >::type> 
struct iterator {
  // types
  typedef unspecified    value_type;     
  typedef Reference      reference;      
  typedef DifferenceType difference_type;
};

Description

The iterator concept can be used for any iterator category.

The value_type of the iterator is deduced. To force it to be a specific type, use the same_type concept.

Example:

mpl::vector<
  iterator<boost::forward_traversal_tag>,
  same_type<iterator<boost::forward_traversal_tag>::value_type, int> > int_it;

Template Parameters

  1. typename Traversal

    must be one of boost::incrementable_traversal_tag, boost::single_pass_traversal_tag, boost::forward_traversal_tag, boost::bidirectional_traversal_tag, and boost::random_access_traversal_tag.

  2. typename T = _self

    The placeholder representing the iterator.

  3. typename Reference = ::boost::use_default

    The reference type. If it is boost::use_default, then reference will be value_type&.

  4. typename DifferenceType = ::std::ptrdiff_t

    The iterator's difference type.

  5. typename ValueType = typename deduced<iterator_value_type<T> >::type

PrevUpHomeNext