| Home | Libraries | People | FAQ | More

#### prior

##### Description

Moves an iterator 1 position backwards.

##### Synopsis

    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

##### Expression Semantics

    prior(i);

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

Semantics: Returns an iterator to the element prior to `i`.

##### Header

    #include <boost/fusion/iterator/prior.hpp>
    #include <boost/fusion/include/prior.hpp>

##### Example

    typedef vector<int,int> vec;

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