3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/front.html
| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Intrinsic Metafunctions / front |
template<
typename Sequence
>
struct[front](./front.html){
typedef_unspecified_type;
};
Returns the first element in the sequence.
#include <[boost/mpl/front.hpp](../../../../boost/mpl/front.hpp)>
| Parameter | Requirement | Description |
|---|---|---|
| Sequence | Forward Sequence | A sequence to be examined. |
For any Forward Sequence s:
typedef[front](./front.html)<s>::type t;
| Return type: |
A type.
| | Precondition: |
empty<s>::value == false.
| | Semantics: |
Equivalent to
typedef[deref](./deref.html)<[begin](./begin.html)<s>::type >::type t;
|
Amortized constant time.
typedef[list](./list.html)<long>::type types1;
typedef[list](./list.html)<int,long>::type types2;
typedef[list](./list.html)<char,int,long>::type types3;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[front](./front.html)<types1>::type, long > ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[front](./front.html)<types2>::type, int> ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[front](./front.html)<types3>::type, char> ));
Forward Sequence, back, push_front, begin, deref, at
| Prev Next | Back Along | Up Home | Full TOC |
Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |