.working ======= <<<<<<< .working >>>>>>> .merge-right.r57125 ======= >>>>>>> .merge-right.r58299
![]() |
Home | Libraries | People | FAQ | More |
Returns the distance between 2 iterators.
<<<<<<< .workingtemplate< typename I, typename J > typename result_of::distance<I, J>::type distance(I const& i, J const& j);
Table 1.5. Parameters
Parameter |
Requirement |
Description |
|---|---|---|
i, j |
Models of Forward Iterator into the same sequence |
The start and end points of the distance to be measured |
distance(i,j);
Return type: int
Semantics: Returns the distance between iterators i and j.
<<<<<<< .working#include <boost/fusion/iterator/distance.hpp> #include <boost/fusion/include/distance.hpp><<<<<<< .working
typedef vector<int,int,int> vec; =======Example
typedefvector<int,int,int> vec; >>>>>>> .merge-right.r57125 vec v(1,2,3); assert(distance(begin(v), next(next(begin(v)))) == 2);