...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Sequences / Intrinsic Metafunctions / front |
Returns the first element in the sequence.
#include <boost/mpl/front.hpp>
Parameter | Requirement | Description |
---|---|---|
Sequence | Forward Sequence | A sequence to be examined. |
For any Forward Sequence s:
typedef front::type t;
Return type: | A type. |
---|---|
Precondition: | empty |
Semantics: | Equivalent to typedef deref< begin |
Amortized constant time.
typedef list::type types1; typedef list ::type types2; typedef list ::type types3; BOOST_MPL_ASSERT(( is_same< front ::type, long > )); BOOST_MPL_ASSERT(( is_same< front ::type, int> )); BOOST_MPL_ASSERT(( is_same< front ::type, char> ));