1 .. Sequences/Intrinsic Metafunctions//begin
16 typedef |unspecified| type;
24 Returns an iterator that points to the first element of the sequence. If
25 the argument is not a |Forward Sequence|, returns |void_|.
33 #include <boost/mpl/begin_end.hpp>
40 |Tag Dispatched Metafunction|
46 +---------------+-------------------+---------------------------------------------------+
47 | Parameter | Requirement | Description |
48 +===============+===================+===================================================+
49 | ``X`` | Any type | A type whose begin iterator, if any, will be |
51 +---------------+-------------------+---------------------------------------------------+
57 For any arbitrary type ``x``:
61 typedef begin<x>::type first;
64 |Forward Iterator| or |void_|.
67 If ``x`` is a |Forward Sequence|, ``first`` is an iterator pointing to the
68 first element of ``s``; otherwise ``first`` is |void_|.
71 If ``first`` is an iterator, it is either dereferenceable or past-the-end; it
72 is past-the-end if and only if ``size<x>::value == 0``.
78 Amortized constant time.
86 typedef vector< unsigned char,unsigned short,
87 unsigned int,unsigned long > unsigned_types;
89 typedef begin<unsigned_types>::type iter;
90 BOOST_MPL_ASSERT(( is_same< deref<iter>::type, unsigned char > ));
92 BOOST_MPL_ASSERT(( is_same< begin<int>::type, void\_ > ));
98 |Iterators|, |Forward Sequence|, |end|, |size|, |empty|
101 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
102 Distributed under the Boost Software License, Version 1.0. (See accompanying
103 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)