[Home]back

Synopsis

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

Description

シーケンスの最後の要素と同一の型を返す.最後の次を指すイテレータの位置の前にある要素である.

Definition

#include "boost/mpl/back.hpp"

Parameters

 Parameter  Requirement  Description  
SequenceForward Sequenceのモデル 調べられるシーケンス.

Expression semantics

 Expression  Expression type  Precondition  Semantics  Postcondition 
typedef back<Sequence>::type t; empty<Sequence>::type::value == false typedef prior< end<Sequence>::type >::type::type t;と同一

Complexity

償却定数時間 [1].

Example

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);

Notes

[1] アルゴリズムは,シーケンスがこの計算量要求を満たす時のみ提供される.

See also

Forward Sequence, front, at, end, push_back


Table of Contents
Last edited July 17, 2002 3:47 am