front
template<
typename Sequence
>
struct front
{
typedef unspecified type;
};
シーケンスの最初の要素と同一の型を返す
#include "boost/mpl/front.hpp"
| Parameter | Requirement | Description |
|---|---|---|
Sequence | Forward Sequenceのモデル | 調べられるシーケンス |
| Expression | Expression type | Precondition | Semantics | Postcondition |
|---|---|---|---|---|
typedef front<Sequence>::type t; |
型 | empty<Sequence>::type::value == false |
typedef begin<Sequence>::type::type t;と等価 |
償却定数時間
typedef list<long>::type types1; typedef list<int,long>::type types2; typedef list<char,int,long>::type types3;BOOST_MPL_ASSERT_IS_SAME(front<types1>::type, long); BOOST_MPL_ASSERT_IS_SAME(front<types2>::type, int); BOOST_MPL_ASSERT_IS_SAME(front<types3>::type, char);
Forward Sequence, back, at, push_front, begin, empty