summaryrefslogtreecommitdiff
path: root/doc/html/boost/array.html
blob: d129e8f04070e9aae3b010f0a44107db17ecc615 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Class template array</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="../index.html" title="The Boost C++ Libraries">
<link rel="up" href="../array/reference.html#header.boost.array.hpp" title="Header &lt;boost/array.hpp&gt;">
<link rel="prev" href="../array/reference.html" title="Reference">
<link rel="next" href="../array/rationale.html" title="Design Rationale">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%">
<td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.htm">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="../../../people/people.htm">People</a></td>
<td align="center"><a href="../../../more/faq.htm">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../array/reference.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../array/reference.html#header.boost.array.hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../array/rationale.html"><img src="../images/next.png" alt="Next"></a>
</div>
<div class="refentry" lang="en">
<a name="boost.array"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template array</span></h2>
<p>boost::array &#8212; <p>STL compliant container wrapper for arrays of constant size</p></p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
<span class="bold"><strong>class</strong></span> array {
<span class="bold"><strong>public</strong></span>:
  <span class="emphasis"><em>// types</em></span>
  <span class="bold"><strong>typedef</strong></span> T                                     value_type;            
  <span class="bold"><strong>typedef</strong></span> T*                                    iterator;              
  <span class="bold"><strong>typedef</strong></span> <span class="bold"><strong>const</strong></span> T*                              const_iterator;        
  <span class="bold"><strong>typedef</strong></span> std::reverse_iterator&lt;iterator&gt;       reverse_iterator;      
  <span class="bold"><strong>typedef</strong></span> std::reverse_iterator&lt;const_iterator&gt; const_reverse_iterator;
  <span class="bold"><strong>typedef</strong></span> T&amp;                                    reference;             
  <span class="bold"><strong>typedef</strong></span> <span class="bold"><strong>const</strong></span> T&amp;                              const_reference;       
  <span class="bold"><strong>typedef</strong></span> std::size_t                           size_type;             
  <span class="bold"><strong>typedef</strong></span> std::ptrdiff_t                        difference_type;       

  <span class="emphasis"><em>// static constants</em></span>
  <span class="bold"><strong>static</strong></span> <span class="bold"><strong>const</strong></span> size_type static_size = N;

  <span class="emphasis"><em>// <a href="array.html#boost.arrayconstruct-copy-destruct">construct/copy/destruct</a></em></span>
  <span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> U&gt; array&amp; <a href="array.html#id2355560-bb"><span class="bold"><strong>operator</strong></span>=</a>(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;U, N&gt;&amp;);

  <span class="emphasis"><em>// <a href="array.html#id2355603-bb">iterator support</a></em></span>
  <span class="type">iterator</span> <a href="array.html#id2355613-bb">begin</a>();
  <span class="type">const_iterator</span> <a href="array.html#id2355621-bb">begin</a>() <span class="bold"><strong>const</strong></span>;
  <span class="type">iterator</span> <a href="array.html#id2355647-bb">end</a>();
  <span class="type">const_iterator</span> <a href="array.html#id2355655-bb">end</a>() <span class="bold"><strong>const</strong></span>;

  <span class="emphasis"><em>// <a href="array.html#id2355679-bb">reverse iterator support</a></em></span>
  <span class="type">reverse_iterator</span> <a href="array.html#id2355688-bb">rbegin</a>();
  <span class="type">const_reverse_iterator</span> <a href="array.html#id2355696-bb">rbegin</a>() <span class="bold"><strong>const</strong></span>;
  <span class="type">reverse_iterator</span> <a href="array.html#id2355718-bb">rend</a>();
  <span class="type">const_reverse_iterator</span> <a href="array.html#id2355726-bb">rend</a>() <span class="bold"><strong>const</strong></span>;

  <span class="emphasis"><em>// <a href="array.html#id2355745-bb">capacity</a></em></span>
  <span class="type">size_type</span> <a href="array.html#id2355750-bb">size</a>();
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2355766-bb">empty</a>();
  <span class="type">size_type</span> <a href="array.html#id2365607-bb">max_size</a>();

  <span class="emphasis"><em>// <a href="array.html#id2365630-bb">element access</a></em></span>
  <span class="type">reference</span> <a href="array.html#id2365639-bb"><span class="bold"><strong>operator</strong></span>[]</a>(size_type);
  <span class="type">const_reference</span> <a href="array.html#id2365657-bb"><span class="bold"><strong>operator</strong></span>[]</a>(size_type) <span class="bold"><strong>const</strong></span>;
  <span class="type">reference</span> <a href="array.html#id2365702-bb">at</a>(size_type);
  <span class="type">const_reference</span> <a href="array.html#id2365720-bb">at</a>(size_type) <span class="bold"><strong>const</strong></span>;
  <span class="type">reference</span> <a href="array.html#id2365766-bb">front</a>();
  <span class="type">const_reference</span> <a href="array.html#id2365773-bb">front</a>() <span class="bold"><strong>const</strong></span>;
  <span class="type">reference</span> <a href="array.html#id2365806-bb">back</a>();
  <span class="type">const_reference</span> <a href="array.html#id2365814-bb">back</a>() <span class="bold"><strong>const</strong></span>;
  <span class="type"><span class="bold"><strong>const</strong></span> T*</span> <a href="array.html#id2365842-bb">data</a>() <span class="bold"><strong>const</strong></span>;
  <span class="type">T*</span> <a href="array.html#id2365865-bb">c_array</a>();

  <span class="emphasis"><em>// <a href="array.html#id2382978-bb">modifiers</a></em></span>
  <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="array.html#id2382982-bb">swap</a>(<a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
  <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="array.html#id2383022-bb">assign</a>(<span class="bold"><strong>const</strong></span> T&amp;);

  T elems[N];
};

<span class="emphasis"><em>// <a href="array.html#id2383061-bb">specialized algorithms</a></em></span>
<span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; <span class="type"><span class="bold"><strong>void</strong></span></span> <a href="array.html#id2383066">swap</a>(<a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);

<span class="emphasis"><em>// <a href="array.html#id2383136-bb">comparisons</a></em></span>
<span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383141"><span class="bold"><strong>operator</strong></span>==</a>(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
<span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383217"><span class="bold"><strong>operator</strong></span>!=</a>(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
<span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383281"><span class="bold"><strong>operator</strong></span>&lt;</a>(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
<span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383361"><span class="bold"><strong>operator</strong></span>&gt;</a>(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
<span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383424"><span class="bold"><strong>operator</strong></span>&lt;=</a>(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);
<span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383487"><span class="bold"><strong>operator</strong></span>&gt;=</a>(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp;);</pre></div>
<div class="refsect1" lang="en">
<a name="id2573974"></a><h2>Description</h2>
<div class="refsect2" lang="en">
<a name="id2573978"></a><h3>
<a name="boost.arrayconstruct-copy-destruct"></a><code class="computeroutput">array</code> construct/copy/destruct</h3>
<div class="orderedlist"><ol type="1"><li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> U&gt; array&amp; <a name="id2355560-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;U, N&gt;&amp; other);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>:

    <code class="computeroutput">std::copy(rhs.<a href="array.html#id2355608-bb">begin</a>(),rhs.<a href="array.html#id2355642-bb">end</a>(), <a href="array.html#id2355608-bb">begin</a>())</code></p>
</li></ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id2574078"></a><h3>
<a name="id2355603-bb"></a><code class="computeroutput">array</code> iterator support</h3>
<div class="orderedlist"><ol type="1">
<li>
<p><a name="id2355608-bb"></a></p>
<pre class="literallayout"><span class="type">iterator</span> <a name="id2355613-bb"></a>begin();
<span class="type">const_iterator</span> <a name="id2355621-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    iterator for the first element<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw</p>
</li>
<li>
<p><a name="id2355642-bb"></a></p>
<pre class="literallayout"><span class="type">iterator</span> <a name="id2355647-bb"></a>end();
<span class="type">const_iterator</span> <a name="id2355655-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    iterator for position after the last element<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw</p>
</li>
</ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id2574203"></a><h3>
<a name="id2355679-bb"></a><code class="computeroutput">array</code> reverse iterator support</h3>
<div class="orderedlist"><ol type="1">
<li>
<p><a name="id2355683-bb"></a></p>
<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id2355688-bb"></a>rbegin();
<span class="type">const_reverse_iterator</span> <a name="id2355696-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    reverse iterator for the first element of reverse iteration</p>
</li>
<li>
<p><a name="id2355713-bb"></a></p>
<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id2355718-bb"></a>rend();
<span class="type">const_reverse_iterator</span> <a name="id2355726-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    reverse iterator for position after the last element in reverse iteration</p>
</li>
</ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id2574317"></a><h3>
<a name="id2355745-bb"></a><code class="computeroutput">array</code> capacity</h3>
<div class="orderedlist"><ol type="1">
<li>
<pre class="literallayout"><span class="type">size_type</span> <a name="id2355750-bb"></a>size();</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">N</code></p>
</li>
<li>
<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2355766-bb"></a>empty();</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">N==0</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw</p>
</li>
<li>
<pre class="literallayout"><span class="type">size_type</span> <a name="id2365607-bb"></a>max_size();</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">N</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw</p>
</li>
</ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id2574443"></a><h3>
<a name="id2365630-bb"></a><code class="computeroutput">array</code> element access</h3>
<div class="orderedlist"><ol type="1">
<li>
<p><a name="id2365634-bb"></a></p>
<pre class="literallayout"><span class="type">reference</span> <a name="id2365639-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type i);
<span class="type">const_reference</span> <a name="id2365657-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type i) <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Requires</span></b>:

    <code class="computeroutput">i &lt; N</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    element with index <code class="computeroutput">i</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw.</p>
</li>
<li>
<p><a name="id2365698-bb"></a></p>
<pre class="literallayout"><span class="type">reference</span> <a name="id2365702-bb"></a>at(size_type i);
<span class="type">const_reference</span> <a name="id2365720-bb"></a>at(size_type i) <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    element with index <code class="computeroutput">i</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    <code class="computeroutput">std::range_error</code> if <code class="computeroutput">i &gt;= N</code></p>
</li>
<li>
<p><a name="id2365761-bb"></a></p>
<pre class="literallayout"><span class="type">reference</span> <a name="id2365766-bb"></a>front();
<span class="type">const_reference</span> <a name="id2365773-bb"></a>front() <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Requires</span></b>:

    <code class="computeroutput">N &gt; 0</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    the first element<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw</p>
</li>
<li>
<p><a name="id2365801-bb"></a></p>
<pre class="literallayout"><span class="type">reference</span> <a name="id2365806-bb"></a>back();
<span class="type">const_reference</span> <a name="id2365814-bb"></a>back() <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Requires</span></b>:

    <code class="computeroutput">N &gt; 0</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    the last element<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw</p>
</li>
<li>
<pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> T*</span> <a name="id2365842-bb"></a>data() <span class="bold"><strong>const</strong></span>;</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">elems</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw</p>
</li>
<li>
<pre class="literallayout"><span class="type">T*</span> <a name="id2365865-bb"></a>c_array();</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">elems</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw</p>
</li>
</ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id2574819"></a><h3>
<a name="id2382978-bb"></a><code class="computeroutput">array</code> modifiers</h3>
<div class="orderedlist"><ol type="1">
<li>
<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2382982-bb"></a>swap(<a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; other);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>:

    <code class="computeroutput">std::swap_ranges(<a href="array.html#id2355608-bb">begin</a>(), <a href="array.html#id2355642-bb">end</a>(), other.<a href="array.html#id2355608-bb">begin</a>())</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Complexity</span></b>:

    linear in <code class="computeroutput">N</code></p>
</li>
<li>
<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2383022-bb"></a>assign(<span class="bold"><strong>const</strong></span> T&amp; value);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>:

    <code class="computeroutput">std::fill_n(<a href="array.html#id2355608-bb">begin</a>(), N, value)</code></p>
</li>
</ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id2574960"></a><h3>
<a name="id2383061-bb"></a><code class="computeroutput">array</code> specialized algorithms</h3>
<div class="orderedlist"><ol type="1"><li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id2383066"></a>swap(<a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>:

    <code class="computeroutput">x.<a href="array.html#id2382982-bb">swap</a>(y)</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>:

    will not throw.</p>
</li></ol></div>
</div>
<div class="refsect2" lang="en">
<a name="id2575053"></a><h3>
<a name="id2383136-bb"></a><code class="computeroutput">array</code> comparisons</h3>
<div class="orderedlist"><ol type="1">
<li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383141"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">std::equal(x.<a href="array.html#id2355608-bb">begin</a>(), x.<a href="array.html#id2355642-bb">end</a>(), y.<a href="array.html#id2355608-bb">begin</a>())</code></p>
</li>
<li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383217"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">!(x == y)</code></p>
</li>
<li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383281"></a><span class="bold"><strong>operator</strong></span>&lt;(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">std::lexicographical_compare(x.<a href="array.html#id2355608-bb">begin</a>(), x.<a href="array.html#id2355642-bb">end</a>(), y.<a href="array.html#id2355608-bb">begin</a>(), y.<a href="array.html#id2355642-bb">end</a>())</code></p>
</li>
<li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383361"></a><span class="bold"><strong>operator</strong></span>&gt;(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">y &lt; x</code></p>
</li>
<li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383424"></a><span class="bold"><strong>operator</strong></span>&lt;=(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">!(y &lt; x)</code></p>
</li>
<li>
<pre class="literallayout"><span class="bold"><strong>template</strong></span>&lt;<span class="bold"><strong>typename</strong></span> T, std::size_t N&gt; 
  <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383487"></a><span class="bold"><strong>operator</strong></span>&gt;=(<span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a>&lt;T, N&gt;&amp; y);</pre>
<p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>:

    <code class="computeroutput">!(x &lt; y)</code></p>
</li>
</ol></div>
</div>
</div>
</div>
<table width="100%"><tr>
<td align="left"></td>
<td align="right"><small>Copyright © 2001-2004 Nicolai M. Josuttis</small></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../array/reference.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../array/reference.html#header.boost.array.hpp"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../array/rationale.html"><img src="../images/next.png" alt="Next"></a>
</div>
</body>
</html>