• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Concept Checking</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. Boost.Iterator">
8<link rel="up" href="../utilities.html" title="Utilities">
9<link rel="prev" href="../utilities.html" title="Utilities">
10<link rel="next" href="iterator_traits.html" title="Iterator Traits">
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="../utilities.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../utilities.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="iterator_traits.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="iterator.utilities.concept_checking"></a><a class="link" href="concept_checking.html" title="Concept Checking">Concept Checking</a>
28</h3></div></div></div>
29<p>
30        The iterator concept checking classes provide a mechanism for a template
31        to report better error messages when a user instantiates the template with
32        a type that does not meet the requirements of the template. For an introduction
33        to using concept checking classes, see the documentation for the <a href="../../../../../concept_check/index.html" target="_top">Boost.ConceptCheck</a>
34        library.
35      </p>
36<h3>
37<a name="iterator.utilities.concept_checking.h0"></a>
38        <span class="phrase"><a name="iterator.utilities.concept_checking.iterator_concepts_hpp_synopsis"></a></span><a class="link" href="concept_checking.html#iterator.utilities.concept_checking.iterator_concepts_hpp_synopsis"><code class="computeroutput"><span class="identifier">iterator_concepts</span><span class="special">.</span><span class="identifier">hpp</span></code> Synopsis</a>
39      </h3>
40<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost_concepts</span> <span class="special">{</span>
41
42    <span class="comment">// Iterator Access Concepts</span>
43
44    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
45    <span class="keyword">class</span> <span class="identifier">ReadableIteratorConcept</span><span class="special">;</span>
46
47    <span class="keyword">template</span> <span class="special">&lt;</span>
48        <span class="keyword">typename</span> <span class="identifier">Iterator</span>
49      <span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">ValueType</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">iterator_traits</span><span class="special">&lt;</span><span class="identifier">Iterator</span><span class="special">&gt;::</span><span class="identifier">value_type</span>
50    <span class="special">&gt;</span>
51    <span class="keyword">class</span> <span class="identifier">WritableIteratorConcept</span><span class="special">;</span>
52
53    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
54    <span class="keyword">class</span> <span class="identifier">SwappableIteratorConcept</span><span class="special">;</span>
55
56    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
57    <span class="keyword">class</span> <span class="identifier">LvalueIteratorConcept</span><span class="special">;</span>
58
59    <span class="comment">// Iterator Traversal Concepts</span>
60
61    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
62    <span class="keyword">class</span> <span class="identifier">IncrementableIteratorConcept</span><span class="special">;</span>
63
64    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
65    <span class="keyword">class</span> <span class="identifier">SinglePassIteratorConcept</span><span class="special">;</span>
66
67    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
68    <span class="keyword">class</span> <span class="identifier">ForwardTraversalConcept</span><span class="special">;</span>
69
70    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
71    <span class="keyword">class</span> <span class="identifier">BidirectionalTraversalConcept</span><span class="special">;</span>
72
73    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">&gt;</span>
74    <span class="keyword">class</span> <span class="identifier">RandomAccessTraversalConcept</span><span class="special">;</span>
75
76    <span class="comment">// Interoperability</span>
77
78    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Iterator</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">ConstIterator</span><span class="special">&gt;</span>
79    <span class="keyword">class</span> <span class="identifier">InteroperableIteratorConcept</span><span class="special">;</span>
80
81<span class="special">}</span>
82</pre>
83</div>
84<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
85<td align="left"></td>
86<td align="right"><div class="copyright-footer">Copyright © 2003, 2005 David Abrahams Jeremy Siek Thomas
87      Witt<p>
88        Distributed under the Boost Software License, Version 1.0. (See accompanying
89        file LICENSE_1_0.txt or copy at &lt;ulink url="http://www.boost.org/LICENSE_1_0.txt"&gt;
90        http://www.boost.org/LICENSE_1_0.txt &lt;/ulink&gt;)
91      </p>
92</div></td>
93</tr></table>
94<hr>
95<div class="spirit-nav">
96<a accesskey="p" href="../utilities.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../utilities.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="iterator_traits.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
97</div>
98</body>
99</html>
100