1.. Sequences/Intrinsic Metafunctions//end
2
3end
4===
5
6Synopsis
7--------
8
9.. parsed-literal::
10
11    template<
12          typename X
13        >
14    struct end
15    {
16        typedef |unspecified| type;
17    };
18
19
20
21Description
22-----------
23
24Returns the sequence's past-the-end iterator. If the argument is not a
25|Forward Sequence|, returns |void_|.
26
27
28Header
29------
30
31.. parsed-literal::
32
33    #include <boost/mpl/begin_end.hpp>
34
35
36Model of
37--------
38
39|Tag Dispatched Metafunction|
40
41
42Parameters
43----------
44
45+---------------+-------------------+-----------------------------------------------+
46| Parameter     | Requirement       | Description                                   |
47+===============+===================+===============================================+
48| ``X``         | Any type          | A type whose end iterator, if any, will be    |
49|               |                   | returned.                                     |
50+---------------+-------------------+-----------------------------------------------+
51
52
53Expression semantics
54--------------------
55
56For any arbitrary type ``x``:
57
58.. parsed-literal::
59
60    typedef end<x>::type last;
61
62:Return type:
63    |Forward Iterator| or |void_|.
64
65:Semantics:
66    If ``x`` is |Forward Sequence|, ``last`` is an iterator pointing one past the
67    last element in ``s``; otherwise ``last`` is |void_|.
68
69:Postcondition:
70    If ``last`` is an iterator, it is past-the-end.
71
72
73Complexity
74----------
75
76Amortized constant time.
77
78
79Example
80-------
81
82.. parsed-literal::
83
84    typedef vector<long> v;
85    typedef begin<v>::type first;
86    typedef end<v>::type last;
87
88    BOOST_MPL_ASSERT(( is_same< next<first>::type, last > ));
89
90
91See also
92--------
93
94|Iterators|, |Forward Sequence|, |begin|, |end|, |next|
95
96
97.. copyright:: Copyright �  2001-2009 Aleksey Gurtovoy and David Abrahams
98   Distributed under the Boost Software License, Version 1.0. (See accompanying
99   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
100