.working ======= <<<<<<< .working >>>>>>> .merge-right.r57125 ======= >>>>>>> .merge-right.r58299
![]() |
Home | Libraries | People | FAQ | More |
Returns the distance between two iterators.
<<<<<<< .workingtemplate< typename I, typename J > struct distance { typedef unspecified type; };
Table 1.16. 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 |
result_of::distance<I, J>::type
Return type: A model of MPL Integral Constant.
Semantics: Returns the distance between iterators of types I and J.
<<<<<<< .working#include <boost/fusion/iterator/distance.hpp> #include <boost/fusion/include/distance.hpp><<<<<<< .working
typedef vector<int,double,char> vec; typedef result_of::begin<vec>::type first; typedef result_of::next<first>::type second; typedef result_of::next<second>::type third; typedef result_of::distance<first,third>::type dist; =======Example
typedefvector<int,double,char> vec; typedefresult_of::begin<vec>::type first; typedefresult_of::next<first>::type second; typedefresult_of::next<second>::type third; typedefresult_of::distance<first,third>::type dist; >>>>>>> .merge-right.r57125 BOOST_MPL_ASSERT_RELATION(dist::value, ==, 2);