Boost C++ Libraries 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 for the latest Boost documentation.



      typename Sequence
struct begin
    typedef unspecified type;


Returns an iterator that points to the first element of the sequence.


#include "boost/mpl/begin_end.hpp"


 Parameter  Requirement  Description  
SequenceA model of Sequence

Expression semantics

 Expression  Expression type  Precondition  Semantics  Postcondition 
typedef begin<Sequence>::type first;A model of Input Iteratorfirst is an iterator pointing to the first element of the Sequence; equivalent to Sequence::begin unless the algorithm has been specialized for the particular type of sequence.first is either dereferenceable or past-the-end; it is past-the-end if and only if size<Sequence>::type::value == 0.


Amortized constant time.


typedef vector<unsigned char,unsigned short,unsigned int, unsigned long> unsigned_types;
typedef begin<unsigned_types>::type iter;
BOOST_STATIC_ASSERT((boost::is_same<iter::type,unsigned char>::value));

See also

Iterators, Sequence, end, size, empty

Table of Contents
Last edited July 22, 2002 2:03 am