Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/doc/src/refmanual/back.rst @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.6 KB

back

Synopsis

template<
      typename Sequence
    >
struct back
{
    typedef |unspecified| type;
};

Description

Returns the last element in the sequence.

Parameters

Parameter Requirement Description
Sequence |Bidirectional Sequence| A sequence to be examined.

Expression semantics

For any |Bidirectional Sequence| s:

typedef back<s>::type t;
Return type:

A type.

Precondition:

empty<s>::value == false.

Semantics:

Equivalent to

typedef deref< prior< end<s>::type >::type >::type t;

Complexity

Amortized constant time.

Example

typedef range_c<int,0,1> range1;
typedef range_c<int,0,10> range2;
typedef range_c<int,-10,0> range3;
BOOST_MPL_ASSERT_RELATION( back<range1>::value, ==, 0 );
BOOST_MPL_ASSERT_RELATION( back<range2>::value, ==, 9 );
BOOST_MPL_ASSERT_RELATION( back<range3>::value, ==, -1 );

Docutils System Messages

??????????
Note: See TracBrowser for help on using the repository browser.