back
template<
typename Sequence
>
struct back
{
typedef unspecified type;
};
シーケンスの最後の要素と同一の型を返す.最後の次を指すイテレータの位置の前にある要素である.
#include "boost/mpl/back.hpp"
| Parameter | Requirement | Description |
|---|---|---|
Sequence | Forward Sequenceのモデル | 調べられるシーケンス. |
| Expression | Expression type | Precondition | Semantics | Postcondition |
|---|---|---|---|---|
typedef back<Sequence>::type t; |
型 | empty<Sequence>::type::value == false |
typedef prior< end<Sequence>::type >::type::type t;と同一 |
償却定数時間 [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] アルゴリズムは,シーケンスがこの計算量要求を満たす時のみ提供される.
Forward Sequence, front, at, end, push_back