Back to Arangodb

front

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/front.html

3.12.9.12.5 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Sequences / Intrinsic Metafunctions / front |

front

Synopsis

template<
      typename Sequence
    >
struct[front](./front.html){
    typedef_unspecified_type;
};

Description

Returns the first element in the sequence.

#include <[boost/mpl/front.hpp](../../../../boost/mpl/front.hpp)>

Model of

Tag Dispatched Metafunction

Parameters

ParameterRequirementDescription
SequenceForward SequenceA sequence to be examined.

Expression semantics

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;

|

Complexity

Amortized constant time.

Example

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

See also

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