...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
template< 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 |
---|---|---|
Sequence | A model of Sequence |
Expression | Expression type | Precondition | Semantics | Postcondition |
---|---|---|---|---|
typedef begin<Sequence>::type first; | A model of Input Iterator | first 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));
Iterators, Sequence, end
, size
, empty