...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Moves an iterator 1 position backwards.
template< typename I > typename result_of::prior<I>::type prior(I const& i);
Table 1.4. Parameters
Parameter |
Requirement |
Description |
---|---|---|
i |
Model of Bidirectional Iterator |
Operation's argument |
prior(i);
Return type: A model of the same iterator concept as i.
Semantics: Returns an iterator to the element prior to i.
#include <boost/fusion/iterator/prior.hpp> #include <boost/fusion/include/prior.hpp>
typedef vector<int,int> vec; vec v(1,2); assert(deref(next(begin(v))) == 2); assert(deref(prior(next(begin(v)))) == 1);