![]() |
Home | Libraries | People | FAQ | More |
Moves an iterator by a specified distance.
template<
typename M,
typename I
>
typename result_of::advance<I, M>::type advance(I const& i);
Table 1.5. Parameters
|
Parameter |
Requirement |
Description |
|---|---|---|
|
|
Model of Forward Iterator |
Iterator to move relative to |
|
|
Number of positions to move |
advance<M>(i);
Return type: A model of the same iterator
concept as i.
Semantics: Returns an iterator to the
element M positions from
i. If i
is a Bidirectional
Iterator then M
may be negative.
#include <boost/fusion/iterator/advance.hpp> #include <boost/fusion/include/advance.hpp>
typedefvector<int,int,int> vec; vec v(1,2,3); assert(deref(advance<mpl::int_<2> >(begin(v))) == 3);