1 | <HTML> |
---|
2 | <!-- |
---|
3 | -- Copyright (c) Jeremy Siek and Andrew Lumsdaine 2000 |
---|
4 | -- |
---|
5 | -- Permission to use, copy, modify, distribute and sell this software |
---|
6 | -- and its documentation for any purpose is hereby granted without fee, |
---|
7 | -- provided that the above copyright notice appears in all copies and |
---|
8 | -- that both that copyright notice and this permission notice appear |
---|
9 | -- in supporting documentation. We make no |
---|
10 | -- representations about the suitability of this software for any |
---|
11 | -- purpose. It is provided "as is" without express or implied warranty. |
---|
12 | --> |
---|
13 | <Head> |
---|
14 | <Title>Boost Concept Checking Reference</Title> |
---|
15 | </Head> |
---|
16 | <BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" |
---|
17 | ALINK="#ff0000"> |
---|
18 | <IMG SRC="../../boost.png" |
---|
19 | ALT="C++ Boost" width="277" height="86"> |
---|
20 | |
---|
21 | <BR Clear> |
---|
22 | |
---|
23 | <h2><a name="reference">Reference</a></h2> |
---|
24 | |
---|
25 | <OL> |
---|
26 | <LI><a href="#functions">Functions</a></LI> |
---|
27 | <LI><a href="#macros">Macros</a></LI> |
---|
28 | <LI><a href="#basic-concepts">Basic Concept Checking Classes</a></LI> |
---|
29 | <LI><a href="#iterator-concepts">Iterator Concept Checking Classes</a></LI> |
---|
30 | <LI><a href="#function-object-concepts">Function Object Concept Checking Classes</a></LI> |
---|
31 | <LI><a href="#container-concepts">Container Concept Checking Classes</a></LI> |
---|
32 | <LI><a href="#basic-archetype">Basic Archetype Classes</a></LI> |
---|
33 | <LI><a href="#iterator-archetype">Iterator Archetype Classes</a></LI> |
---|
34 | <LI><a href="#function-object-archetype">Function Object Archetype Classes</a></LI> |
---|
35 | <LI><a href="#container-archetype">Container Archetype Classes</a></LI> |
---|
36 | </OL> |
---|
37 | |
---|
38 | <h3><a name="functions">Functions</a></h3> |
---|
39 | |
---|
40 | <pre> |
---|
41 | template <class Concept> |
---|
42 | void function_requires(); |
---|
43 | </pre> |
---|
44 | |
---|
45 | <h3><a name="macros">Macros</a></h3> |
---|
46 | |
---|
47 | <pre> |
---|
48 | // Apply concept checks in class definitions. |
---|
49 | BOOST_CLASS_REQUIRE(<i>type</i>, <i>namespace-of-concept</i>, <i>concept</i>); |
---|
50 | BOOST_CLASS_REQUIRE2(<i>type1</i>, <i>type2</i>, <i>namespace-of-concept</i>, <i>concept</i>); |
---|
51 | BOOST_CLASS_REQUIRE3(<i>type1</i>, <i>type2</i>, <i>type3</i>, <i>namespace-of-concept</i>, <i>concept</i>); |
---|
52 | BOOST_CLASS_REQUIRE4(<i>type1</i>, <i>type2</i>, <i>type3</i>, <i>type4</i>, <i>namespace-of-concept</i>, <i>concept</i>); |
---|
53 | </pre> |
---|
54 | |
---|
55 | Deprecated macros: |
---|
56 | |
---|
57 | <pre> |
---|
58 | // Apply concept checks in class definitions. |
---|
59 | BOOST_CLASS_REQUIRES(<i>type</i>, <i>concept</i>); |
---|
60 | BOOST_CLASS_REQUIRES2(<i>type1</i>, <i>type2</i>, <i>concept</i>); |
---|
61 | BOOST_CLASS_REQUIRES3(<i>type1</i>, <i>type2</i>, <i>type3</i>, <i>concept</i>); |
---|
62 | BOOST_CLASS_REQUIRES4(<i>type1</i>, <i>type2</i>, <i>type3</i>, <i>type4</i>, <i>concept</i>); |
---|
63 | </pre> |
---|
64 | |
---|
65 | <h3><a name="basic-concepts">Basic Concept Checking Classes</a></h3> |
---|
66 | |
---|
67 | <pre> |
---|
68 | template <class T> |
---|
69 | struct IntegerConcept; // Is T a built-in integer type? |
---|
70 | |
---|
71 | template <class T> |
---|
72 | struct SignedIntegerConcept; // Is T a built-in signed integer type? |
---|
73 | |
---|
74 | template <class T> |
---|
75 | struct UnsignedIntegerConcept; // Is T a built-in unsigned integer type? |
---|
76 | |
---|
77 | template <class X, class Y> |
---|
78 | struct ConvertibleConcept; // Is X convertible to Y? |
---|
79 | |
---|
80 | template <class T> |
---|
81 | struct <a href="../utility/Assignable.html">Assignable</a>Concept; // Standard ref 23.1 |
---|
82 | |
---|
83 | template <class T> |
---|
84 | struct SGI<a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>Concept; |
---|
85 | |
---|
86 | template <class T> |
---|
87 | struct <a |
---|
88 | href="http://www.sgi.com/tech/stl/DefaultConstructible.html">DefaultConstructible</a>Concept; |
---|
89 | |
---|
90 | template <class T> |
---|
91 | struct <a href="../utility/CopyConstructible.html">CopyConstructible</a>Concept; // Standard ref 20.1.3 |
---|
92 | |
---|
93 | template <class T> |
---|
94 | struct <a href="http://www.sgi.com/tech/stl/EqualityComparable.html">EqualityComparable</a>Concept; // Standard ref 20.1.1 |
---|
95 | |
---|
96 | template <class T> |
---|
97 | struct <a href="../utility/LessThanComparable.html">LessThanComparable</a>Concept; // Standard ref 20.1.2 |
---|
98 | |
---|
99 | template <class T> |
---|
100 | struct ComparableConcept; // The SGI STL <a href="http://www.sgi.com/tech/stl/LessThanComparable.html">LessThanComparable</a> concept |
---|
101 | </pre> |
---|
102 | |
---|
103 | <h3><a name="iterator-concepts">Iterator Concept Checking Classes</a></h3> |
---|
104 | |
---|
105 | <pre> |
---|
106 | template <class Iter> |
---|
107 | struct <a href="http://www.sgi.com/tech/stl/InputIterator.html">InputIterator</a>Concept; // Standard ref 24.1.1 Table 72 |
---|
108 | |
---|
109 | template <class Iter, class T> |
---|
110 | struct <a href="http://www.sgi.com/tech/stl/OutputIterator.html">OutputIterator</a>Concept; // Standard ref 24.1.2 Table 73 |
---|
111 | |
---|
112 | template <class Iter> |
---|
113 | struct <a href="http://www.sgi.com/tech/stl/ForwardIterator.html">ForwardIterator</a>Concept; // Standard ref 24.1.3 Table 74 |
---|
114 | |
---|
115 | template <class Iter> |
---|
116 | struct Mutable_ForwardIteratorConcept; |
---|
117 | |
---|
118 | template <class Iter> |
---|
119 | struct <a href="http://www.sgi.com/tech/stl/BidirectionalIterator.html">BidirectionalIterator</a>Concept; // Standard ref 24.1.4 Table 75 |
---|
120 | |
---|
121 | template <class Iter> |
---|
122 | struct Mutable_BidirectionalIteratorConcept; |
---|
123 | |
---|
124 | template <class Iter> |
---|
125 | struct <a href="http://www.sgi.com/tech/stl/RandomAccessIterator.html">RandomAccessIterator</a>Concept; // Standard ref 24.1.5 Table 76 |
---|
126 | |
---|
127 | template <class Iter> |
---|
128 | struct Mutable_RandomAccessIteratorConcept; |
---|
129 | </pre> |
---|
130 | |
---|
131 | <h3><a name="function-object-concepts">Function Object Concept Checking Classes</a></h3> |
---|
132 | |
---|
133 | <pre> |
---|
134 | template <class Func, class Return> |
---|
135 | struct <a href="http://www.sgi.com/tech/stl/Generator.html">Generator</a>Concept; |
---|
136 | |
---|
137 | template <class Func, class Return, class Arg> |
---|
138 | struct <a href="http://www.sgi.com/tech/stl/UnaryFunction.html">UnaryFunction</a>Concept; |
---|
139 | |
---|
140 | template <class Func, class Return, class First, class Second> |
---|
141 | struct <a href="http://www.sgi.com/tech/stl/BinaryFunction.html">BinaryFunction</a>Concept; |
---|
142 | |
---|
143 | template <class Func, class Arg> |
---|
144 | struct Unary<a href="http://www.sgi.com/tech/stl/Predicate.html">Predicate</a>Concept; |
---|
145 | |
---|
146 | template <class Func, class First, class Second> |
---|
147 | struct <a href="http://www.sgi.com/tech/stl/BinaryPredicate.html">BinaryPredicate</a>Concept; |
---|
148 | |
---|
149 | template <class Func, class First, class Second> |
---|
150 | struct Const_BinaryPredicateConcept; |
---|
151 | |
---|
152 | template <class Func, class Return> |
---|
153 | struct <a href="http://www.sgi.com/tech/stl/AdaptableGenerator.html">AdaptableGenerator</a>Concept; |
---|
154 | |
---|
155 | template <class Func, class Return, class Arg> |
---|
156 | struct <a href="http://www.sgi.com/tech/stl/AdaptableUnaryFunction.html">AdaptableUnaryFunction</a>Concept; |
---|
157 | |
---|
158 | template <class Func, class First, class Second> |
---|
159 | struct <a href="http://www.sgi.com/tech/stl/AdaptableBinaryFunction.html">AdaptableBinaryFunction</a>Concept; |
---|
160 | |
---|
161 | template <class Func, class Arg> |
---|
162 | struct <a href="http://www.sgi.com/tech/stl/AdaptablePredicate.html">AdaptablePredicate</a>Concept; |
---|
163 | |
---|
164 | template <class Func, class First, class Second> |
---|
165 | struct <a href="http://www.sgi.com/tech/stl/AdaptableBinaryPredicate.html">AdaptableBinaryPredicate</a>Concept; |
---|
166 | |
---|
167 | </pre> |
---|
168 | |
---|
169 | <h3><a name="container-concepts">Container Concept Checking Classes</a></h3> |
---|
170 | |
---|
171 | <pre> |
---|
172 | template <class C> |
---|
173 | struct <a href="http://www.sgi.com/tech/stl/Container.html">Container</a>Concept; // Standard ref 23.1 Table 65 |
---|
174 | |
---|
175 | template <class C> |
---|
176 | struct Mutable_ContainerConcept; |
---|
177 | |
---|
178 | template <class C> |
---|
179 | struct <a href="http://www.sgi.com/tech/stl/ForwardContainer.html">ForwardContainer</a>Concept; |
---|
180 | |
---|
181 | template <class C> |
---|
182 | struct Mutable_ForwardContainerConcept; |
---|
183 | |
---|
184 | template <class C> |
---|
185 | struct <a href="http://www.sgi.com/tech/stl/ReversibleContainer.html">ReversibleContainer</a>Concept; // Standard ref 23.1 Table 66 |
---|
186 | |
---|
187 | template <class C> |
---|
188 | struct Mutable_ReversibleContainerConcept; |
---|
189 | |
---|
190 | template <class C> |
---|
191 | struct <a href="http://www.sgi.com/tech/stl/RandomAccessContainer.html">RandomAccessContainer</a>Concept; |
---|
192 | |
---|
193 | template <class C> |
---|
194 | struct Mutable_RandomAccessContainerConcept; |
---|
195 | |
---|
196 | template <class C> |
---|
197 | struct <a href="http://www.sgi.com/tech/stl/Sequence.html">Sequence</a>Concept; // Standard ref 23.1.1 |
---|
198 | |
---|
199 | template <class C> |
---|
200 | struct <a href="http://www.sgi.com/tech/stl/FrontInsertionSequence.html">FrontInsertionSequence</a>Concept; |
---|
201 | |
---|
202 | template <class C> |
---|
203 | struct <a href="http://www.sgi.com/tech/stl/BackInsertionSequence.html">BackInsertionSequence</a>Concept; |
---|
204 | |
---|
205 | template <class C> |
---|
206 | struct <a href="http://www.sgi.com/tech/stl/AssociativeContainer.html">AssociativeContainer</a>Concept; // Standard ref 23.1.2 Table 69 |
---|
207 | |
---|
208 | template <class C> |
---|
209 | struct <a href="http://www.sgi.com/tech/stl/UniqueAssociativeContainer.html">UniqueAssociativeContainer</a>Concept; |
---|
210 | |
---|
211 | template <class C> |
---|
212 | struct <a href="http://www.sgi.com/tech/stl/MultipleAssociativeContainer.html">MultipleAssociativeContainer</a>Concept; |
---|
213 | |
---|
214 | template <class C> |
---|
215 | struct <a href="http://www.sgi.com/tech/stl/SimpleAssociativeContainer.html">SimpleAssociativeContainer</a>Concept; |
---|
216 | |
---|
217 | template <class C> |
---|
218 | struct <a href="http://www.sgi.com/tech/stl/PairAssociativeContainer.html">PairAssociativeContainer</a>Concept; |
---|
219 | |
---|
220 | template <class C> |
---|
221 | struct <a href="http://www.sgi.com/tech/stl/SortedAssociativeContainer.html">SortedAssociativeContainer</a>Concept; |
---|
222 | </pre> |
---|
223 | |
---|
224 | |
---|
225 | <h3><a name="basic-archetype">Basic Archetype Classes</a></h3> |
---|
226 | |
---|
227 | <pre> |
---|
228 | template <class T = int> |
---|
229 | class null_archetype; // A type that models no concepts. |
---|
230 | |
---|
231 | template <class Base = null_archetype> |
---|
232 | class default_constructible_archetype; |
---|
233 | |
---|
234 | template <class Base = null_archetype> |
---|
235 | class assignable_archetype; |
---|
236 | |
---|
237 | template <class Base = null_archetype> |
---|
238 | class copy_constructible_archetype; |
---|
239 | |
---|
240 | template <class Base = null_archetype> |
---|
241 | class equality_comparable_archetype; |
---|
242 | |
---|
243 | template <class T, class Base = null_archetype> |
---|
244 | class convertible_to_archetype; |
---|
245 | </pre> |
---|
246 | |
---|
247 | <h3><a name="iterator-archetype">Iterator Archetype Classes</a></h3> |
---|
248 | |
---|
249 | <pre> |
---|
250 | template <class ValueType> |
---|
251 | class trivial_iterator_archetype; |
---|
252 | |
---|
253 | template <class ValueType> |
---|
254 | class mutable_trivial_iterator_archetype; |
---|
255 | |
---|
256 | template <class ValueType> |
---|
257 | class input_iterator_archetype; |
---|
258 | |
---|
259 | template <class ValueType> |
---|
260 | class forward_iterator_archetype; |
---|
261 | |
---|
262 | template <class ValueType> |
---|
263 | class bidirectional_iterator_archetype; |
---|
264 | |
---|
265 | template <class ValueType> |
---|
266 | class random_access_iterator_archetype; |
---|
267 | |
---|
268 | </pre> |
---|
269 | |
---|
270 | <h3><a name="function-object-archetype">Function Object Archetype Classes</a></h3> |
---|
271 | |
---|
272 | <pre> |
---|
273 | template <class Arg, class Return> |
---|
274 | class unary_function_archetype; |
---|
275 | |
---|
276 | template <class Arg1, class Arg2, class Return> |
---|
277 | class binary_function_archetype; |
---|
278 | |
---|
279 | template <class Arg> |
---|
280 | class predicate_archetype; |
---|
281 | |
---|
282 | template <class Arg1, class Arg2> |
---|
283 | class binary_predicate_archetype; |
---|
284 | </pre> |
---|
285 | |
---|
286 | <h3><a name="container-archetype">Container Archetype Classes</a></h3> |
---|
287 | |
---|
288 | <pre> |
---|
289 | UNDER CONSTRUCTION |
---|
290 | </pre> |
---|
291 | |
---|
292 | <p> |
---|
293 | <a href="./concept_check.htm">Back to Introduction</a> |
---|
294 | <br> |
---|
295 | <a href="./implementation.htm">Prev: Implementation</a> |
---|
296 | |
---|
297 | <br> |
---|
298 | <HR> |
---|
299 | <TABLE> |
---|
300 | <TR valign=top> |
---|
301 | <TD nowrap>Copyright © 2000</TD><TD> |
---|
302 | <A HREF="../../people/jeremy_siek.htm">Jeremy Siek</A>(<A |
---|
303 | HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>) |
---|
304 | Andrew Lumsdaine</A>(<A HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>) |
---|
305 | </TD></TR></TABLE> |
---|
306 | |
---|
307 | </BODY> |
---|
308 | </HTML> |
---|