...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::type_erasure::iterator
// In header: <boost/type_erasure/iterator.hpp> template<typename Traversal, typename T = _self, typename Reference = boost::use_default, typename DifferenceType = std::ptrdiff_t> struct iterator { // types typedef unspecified value_type; typedef Reference reference; typedef DifferenceType difference_type; };
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;
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
.
typename T = _self
The placeholder representing the iterator.
typename Reference = boost::use_default
The reference type. If it is boost::use_default, then reference will be value_type&.
typename DifferenceType = std::ptrdiff_t
The iterator's difference type.