template< typename Sequence > struct back { typedef unspecified type; };
Returns a type identical to the last element in the sequence, that is, the element in a position that preceeds the position of past-the-end iterator.
#include "boost/mpl/back.hpp"
Parameter | Requirement | Description |
---|---|---|
Sequence | A model of Forward Sequence | A sequence to be examined. |
Expression | Expression type | Precondition | Semantics | Postcondition |
---|---|---|---|---|
typedef back<Sequence>::type t; | A type | empty<Sequence>::type::value == false | Equivalent to typedef prior< end<Sequence>::type >::type::type t; |
Amortized constant time [1].
typedef range_c<int,0,1> range1; typedef range_c<int,0,10> range2; typedef range_c<int,-10,0> range3;BOOST_STATIC_ASSERT(back<range1>::type::value == 0); BOOST_STATIC_ASSERT(back<range2>::type::value == 9); BOOST_STATIC_ASSERT(back<range3>::type::value == -1);
[1] The algorithm is provided only if the sequence can meet the stated complexity requirements.
Forward Sequence, front
, at
, end
, push_back