.working ======= <<<<<<< .working >>>>>>> .merge-right.r57125 ======= >>>>>>> .merge-right.r58299
![]() |
Home | Libraries | People | FAQ | More |
Moves an iterator a specified distance.
<<<<<<< .workingtemplate< typename I, typename M > struct advance { typedef unspecified type; };
Table 1.17. Parameters
Parameter |
Requirement |
Description |
---|---|---|
I |
Model of Forward Iterator |
Iterator to move relative to |
M |
Model of MPL Integral Constant |
Number of positions to move |
result_of::advance<I,M>::type
Return type: A model of the same iterator concept as I.
Semantics: Returns an iterator a distance M from I. If I is a Bidirectional Iterator then M may be negative.
<<<<<<< .working#include <boost/fusion/iterator/advance.hpp> #include <boost/fusion/include/advance.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; =======Example
typedefvector
<int,double,char> vec; typedefresult_of::begin
<vec>::type first; typedefresult_of::next
<first>::type second; typedefresult_of::next
<second>::type third; >>>>>>> .merge-right.r57125 BOOST_MPL_ASSERT((result_of::equal_to<result_of::advance<first, boost::mpl::int_<2> >::type, third>));