Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/doc/src/refmanual/front.rst @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.7 KB

front

Synopsis

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

Description

Returns the first element in the sequence.

Parameters

Parameter Requirement Description
Sequence |Forward Sequence| A sequence to be examined.

Expression semantics

For any |Forward Sequence| s:

typedef front<s>::type t;
Return type:

A type.

Precondition:

empty<s>::value == false.

Semantics:

Equivalent to

typedef deref< begin<s>::type >::type t;

Complexity

Amortized constant time.

Example

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

Docutils System Messages

??????????
Note: See TracBrowser for help on using the repository browser.