template< typename Sequence > struct front { typedef unspecified type; };
Returns a type identical to the first element in the sequence.
#include "boost/mpl/front.hpp"
Parameter | Requirement | Description |
---|---|---|
Sequence | A model of Forward Sequence | A sequence to be examined. |
Expression | Expression type | Precondition | Semantics | Postcondition |
---|---|---|---|---|
typedef front<Sequence>::type t; | A type | empty<Sequence>::type::value == false | Equivalent to typedef begin<Sequence>::type::type t; |
Amortized constant time.
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