source:
downloads/boost_1_33_1/libs/mpl/doc/src/refmanual/next.rst
@
12
Last change on this file since 12 was 12, checked in by landauf, 18 years ago | |
---|---|
File size: 2.0 KB |
next
Synopsis
template< typename Iterator > struct next { typedef |unspecified| type; };
Description
Returns the next iterator in the sequence. |Note:| next has a number of overloaded meanings, depending on the type of its argument. For instance, if X is an |Integral Constant|, next<X> returns an incremented |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|.
Header
#include <boost/mpl/next_prior.hpp>
Parameters
Parameter | Requirement | Description |
---|---|---|
Iterator | |Forward Iterator|. | An iterator to increment. |
Expression semantics
For any |Forward Iterator|s iter:
typedef next<iter>::type j;
Return type: | |
---|---|
Precondition: | iter is incrementable. |
Semantics: | j is an iterator pointing to the next element in the sequence, or is past-the-end. If iter is a user-defined iterator, the library-provided default implementation is equivalent to typedef iter::next j; |
Complexity
Amortized constant time.
Example
typedef vector_c<int,1> v; typedef begin<v>::type first; typedef end<v>::type last; BOOST_MPL_ASSERT(( is_same< next<first>::type, last > ));