Back to Arangodb

prior

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/prior.html

3.12.9.12.7 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Iterators / Iterator Metafunctions / prior |

prior

Synopsis

template<
      typename Iterator
    >
struct[prior](./prior.html){
    typedef_unspecified_type;
};

Description

Returns the previous iterator in the sequence. [Note: prior has a number of overloaded meanings, depending on the type of its argument. For instance, if X is an Integral Constant, prior<X> returns an decremented Integral Constant of the same type. The following specification is iterator-specific. Please refer to the corresponding concept's documentation for the details of the alternative semantics — end note].

#include <[boost/mpl/next\_prior.hpp](../../../../boost/mpl/next_prior.hpp)>

Parameters

ParameterRequirementDescription
IteratorBidirectional Iterator.An iterator to decrement.

Expression semantics

For any Bidirectional Iterators iter:

typedef[prior](./prior.html)<iter>::type j;

| Return type: |

Bidirectional Iterator.

| | Precondition: |

iter is decrementable.

| | Semantics: |

j is an iterator pointing to the previous element in the sequence. If iter is a user-defined iterator, the library-provided default implementation is equivalent to

typedef iter::[prior](./prior.html)j;

|

Complexity

Amortized constant time.

Example

typedef[vector\_c](./vector-c.html)<int,1> v;
typedef[begin](./begin.html)<v>::type first;
typedef[end](./end.html)<v>::type last;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[prior](./prior.html)<last>::type, first > ));

See also

Iterators, begin / end, next, deref

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |