...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
template< typename Iterator > struct iterator_category { typedef unspecified type; };
Returns one of the following iterator category tags: input_iterator_tag
, forward_iterator_tag
, bidirectional_iterator_tag
, or random_access_iterator_tag
.
#include "boost/mpl/iterator_category.hpp" #include "boost/mpl/iterator_tag.hpp"
Parameter | Requirement | Description |
---|---|---|
Iterator | A model of Input Iterator |
Expression | Expression type | Precondition | Semantics | Postcondition |
---|---|---|---|---|
typedef iterator_category<Iterator>::type tag; | An iterator category tag | tag is input_iterator_tag if Iterator is a model of Input Iterator, forward_iterator_tag if Iterator is a model of Forward Iterator, bidirectional_iterator_tag if Iterator is a model of Bidirectional Iterator, or random_access_iterator_tag if Iterator is a model of Random Access Iterator. |
Amortized constant time.
template< typename Iterator > struct my_algorithm : my_algorithm_impl< iterator_category<Iterator>::type , Iterator > { };
Iterators, Sequence, begin
, end
, advance
, distance