Back to Arangodb

begin

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

3.12.9.12.7 KB
Original Source

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

begin

Synopsis

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

Description

Returns an iterator that points to the first element of the sequence. If the argument is not a Forward Sequence, returns void_.

#include <[boost/mpl/begin\_end.hpp](../../../../boost/mpl/begin_end.hpp)>

Model of

Tag Dispatched Metafunction

Parameters

ParameterRequirementDescription
XAny typeA type whose begin iterator, if any, will be returned.

Expression semantics

For any arbitrary type x:

typedef[begin](./begin.html)<x>::type first;

| Return type: | Forward Iterator or void_. | | Semantics: | If x is a Forward Sequence, first is an iterator pointing to the first element of s; otherwise first is void_. | | Postcondition: | If first is an iterator, it is either dereferenceable or past-the-end; it is past-the-end if and only if size<x>::value == 0. |

Complexity

Amortized constant time.

Example

typedef[vector](./vector.html)< unsigned char,unsigned short,
    unsigned int,unsigned long > unsigned_types;

typedef[begin](./begin.html)<unsigned_types>::type iter;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[deref](./deref.html)<iter>::type, unsigned char > ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<[begin](./begin.html)<int>::type,[void\_](./void.html)> ));

See also

Iterators, Forward Sequence, end, size, empty

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