![]() |
Home | Libraries | People | FAQ | More |
Returns the distance between 2 iterators.
template<
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
.
#include <boost/fusion/iterator/distance.hpp>
typedefvector
<int,int,int> vec; vec v(1,2,3); assert(distance
(begin
(v),next
(next
(begin
(v)))) == 2);
Copyright © 2001-2005 Joel de Guzman, Dan Marsden |