Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
begin
Description

Returns an iterator pointing to the first element in the sequence.

Synopsis
template <typename Sequence>
typename result_of::begin<Sequence>::type
begin(Sequence& seq);

template <typename Sequence>
typename result_of::begin<Sequence const>::type
begin(Sequence const& seq);
Parameters

Parameter

Requirement

Description

seq

Model of Forward Sequence

The sequence we wish to get an iterator from.

Expression Semantics
begin(seq);

Return type:

Semantics: Returns an iterator pointing to the first element in the sequence.

Header
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/fusion/include/begin.hpp>
Example
vector<int, int, int> v(1, 2, 3);
assert(deref(begin(v)) == 1);

PrevUpHomeNext