![]() |
Home | Libraries | People | FAQ | More |
Moves an iterator by a specified distance.
template<
int N,
typename I
>
typename result_of::advance_c<I, N>::type advance_c(I const& i);
Table 1.6. Parameters
|
Parameter |
Requirement |
Description |
|---|---|---|
|
|
Model of Forward Iterator |
Iterator to move relative to |
|
|
Integer constant |
Number of positions to move |
advance_c<N>(i);
Return type: A model of the same iterator
concept as i.
Semantics: Returns an iterator to the
element N positions from
i. If i
is a Bidirectional
Iterator then N
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_c<2>(begin(v))) == 3);