• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Overview</title>
5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../index.html" title="Chapter 1. Range 2.0">
8<link rel="up" href="../concepts.html" title="Range Concepts">
9<link rel="prev" href="../concepts.html" title="Range Concepts">
10<link rel="next" href="single_pass_range.html" title="Single Pass Range">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="../concepts.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="single_pass_range.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h3 class="title">
27<a name="range.concepts.overview"></a><a class="link" href="overview.html" title="Overview">Overview</a>
28</h3></div></div></div>
29<p>
30        A Range is a <span class="bold"><strong><span class="emphasis"><em>concept</em></span></strong></span>
31        similar to the STL <a href="http://www.sgi.com/tech/stl/Container.html" target="_top">Container</a>
32        concept. A Range provides iterators for accessing a half-open range <code class="computeroutput"><span class="special">[</span><span class="identifier">first</span><span class="special">,</span><span class="identifier">one_past_last</span><span class="special">)</span></code> of elements and provides information about
33        the number of elements in the Range. However, a Range has fewer requirements
34        than a Container.
35      </p>
36<p>
37        The motivation for the Range concept is that there are many useful Container-like
38        types that do not meet the full requirements of Container, and many algorithms
39        that can be written with this reduced set of requirements. In particular,
40        a Range does not necessarily
41      </p>
42<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
43<li class="listitem">
44            own the elements that can be accessed through it,
45          </li>
46<li class="listitem">
47            have copy semantics,
48          </li>
49</ul></div>
50<p>
51        Because of the second requirement, a Range object must be passed by (const
52        or non-const) reference in generic code.
53      </p>
54<p>
55        The operations that can be performed on a Range is dependent on the <a href="../../../../../../libs/iterator/doc/new-iter-concepts.html#iterator-traversal-concepts-lib-iterator-traversal" target="_top">traversal
56        category</a> of the underlying iterator type. Therefore the range concepts
57        are named to reflect which traversal category its iterators support. See
58        also terminology and style guidelines. for more information about naming
59        of ranges.
60      </p>
61<p>
62        The concepts described below specifies associated types as <a href="../../../../../../libs/mpl/doc/refmanual/metafunction.html" target="_top">metafunctions</a>
63        and all functions as free-standing functions to allow for a layer of indirection.
64      </p>
65</div>
66<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
67<td align="left"></td>
68<td align="right"><div class="copyright-footer">Copyright © 2003-2010 Thorsten Ottosen,
69      Neil Groves<p>
70        Distributed under the Boost Software License, Version 1.0. (See accompanying
71        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
72      </p>
73</div></td>
74</tr></table>
75<hr>
76<div class="spirit-nav">
77<a accesskey="p" href="../concepts.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="single_pass_range.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
78</div>
79</body>
80</html>
81