Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit c89e626766.
PrevUpHomeNext

next

Description

Moves an iterator 1 position forwards.

Synopsis
template<
    typename I
    >
typename result_of::next<I>::type next(I const& i);

Table 1.2. Parameters

Parameter

Requirement

Description

i

Model of Forward Iterator

Operation's argument


Expression Semantics
next(i);

Return type: A model of the same iterator concept as i.

Semantics: Returns an iterator to the next element after i.

Header
#include <boost/fusion/iterator/next.hpp>
#include <boost/fusion/include/next.hpp>
Example
typedef vector<int,int,int> vec;

vec v(1,2,3);
assert(deref(begin(v)) == 1);
assert(deref(next(begin(v))) == 2);
assert(deref(next(next(begin(v)))) == 3);

PrevUpHomeNext