1.. Sequences/Views//iterator_range
2
3iterator_range
4==============
5
6Synopsis
7--------
8
9.. parsed-literal::
10
11    template<
12          typename First
13        , typename Last
14        >
15    struct iterator_range
16    {
17        // |unspecified|
18        // |...|
19    };
20
21
22Description
23-----------
24
25A view into subset of sequence elements identified by a pair of iterators.
26
27
28Header
29------
30
31.. parsed-literal::
32
33    #include <boost/mpl/fold.hpp>
34
35
36Model of
37--------
38
39* `Forward`__, `Bidirectional`__, or |Random Access Sequence|, depending on the category
40  of the underlaying iterators.
41
42__ `Forward Sequence`_
43__ `Bidirectional Sequence`_
44
45
46
47Parameters
48----------
49
50+---------------+-----------------------------------+-----------------------------------------------+
51| Parameter     | Requirement                       | Description                                   |
52+===============+===================================+===============================================+
53| ``First``,    | |Forward Iterator|                | Iterators identifying the view's boundaries.  |
54| ``Last``      |                                   |                                               |
55+---------------+-----------------------------------+-----------------------------------------------+
56
57
58Expression semantics
59--------------------
60
61|Semantics disclaimer...| |Forward Sequence|.
62
63In the following table, ``v`` is an instance of ``iterator_range``, ``first`` and ``last`` are
64iterators into a |Forward Sequence|, and [``first``, ``last``) form a valid range.
65
66+-------------------------------------------+-------------------------------------------------------+
67| Expression                                | Semantics                                             |
68+===========================================+=======================================================+
69| .. parsed-literal::                       | A lazy sequence all the elements in the range         |
70|                                           | [``first``, ``last``).                                |
71|    iterator_range<first,last>             |                                                       |
72|    iterator_range<first,last>::type       |                                                       |
73+-------------------------------------------+-------------------------------------------------------+
74
75Example
76-------
77
78.. parsed-literal::
79
80    typedef range_c<int,0,100> r;
81    typedef advance_c< begin<r>::type,10 >::type first;
82    typedef advance_c< end<r>::type,-10 >::type last;
83
84    BOOST_MPL_ASSERT(( equal<
85          iterator_range<first,last>
86        , range_c<int,10,90>
87        > ));
88
89
90See also
91--------
92
93|Sequences|, |Views|, |filter_view|, |transform_view|, |joint_view|, |zip_view|, |max_element|
94
95
96.. copyright:: Copyright �  2001-2009 Aleksey Gurtovoy and David Abrahams
97   Distributed under the Boost Software License, Version 1.0. (See accompanying
98   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
99