1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
---|
4 | <title>Class template array</title> |
---|
5 | <link rel="stylesheet" href="../boostbook.css" type="text/css"> |
---|
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.69.1"> |
---|
7 | <link rel="start" href="../index.html" title="The Boost C++ Libraries"> |
---|
8 | <link rel="up" href="../array/reference.html#header.boost.array.hpp" title="Header <boost/array.hpp>"> |
---|
9 | <link rel="prev" href="../array/reference.html" title="Reference"> |
---|
10 | <link rel="next" href="../array/rationale.html" title="Design Rationale"> |
---|
11 | </head> |
---|
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
---|
13 | <table cellpadding="2" width="100%"> |
---|
14 | <td valign="top"><img alt="boost.png (6897 bytes)" width="277" height="86" src="../../../boost.png"></td> |
---|
15 | <td align="center"><a href="../../../index.htm">Home</a></td> |
---|
16 | <td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> |
---|
17 | <td align="center"><a href="../../../people/people.htm">People</a></td> |
---|
18 | <td align="center"><a href="../../../more/faq.htm">FAQ</a></td> |
---|
19 | <td align="center"><a href="../../../more/index.htm">More</a></td> |
---|
20 | </table> |
---|
21 | <hr> |
---|
22 | <div class="spirit-nav"> |
---|
23 | <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> |
---|
24 | </div> |
---|
25 | <div class="refentry" lang="en"> |
---|
26 | <a name="boost.array"></a><div class="titlepage"></div> |
---|
27 | <div class="refnamediv"> |
---|
28 | <h2><span class="refentrytitle">Class template array</span></h2> |
---|
29 | <p>boost::array — <p>STL compliant container wrapper for arrays of constant size</p></p> |
---|
30 | </div> |
---|
31 | <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> |
---|
32 | <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><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
33 | <span class="bold"><strong>class</strong></span> array { |
---|
34 | <span class="bold"><strong>public</strong></span>: |
---|
35 | <span class="emphasis"><em>// types</em></span> |
---|
36 | <span class="bold"><strong>typedef</strong></span> T value_type; |
---|
37 | <span class="bold"><strong>typedef</strong></span> T* iterator; |
---|
38 | <span class="bold"><strong>typedef</strong></span> <span class="bold"><strong>const</strong></span> T* const_iterator; |
---|
39 | <span class="bold"><strong>typedef</strong></span> std::reverse_iterator<iterator> reverse_iterator; |
---|
40 | <span class="bold"><strong>typedef</strong></span> std::reverse_iterator<const_iterator> const_reverse_iterator; |
---|
41 | <span class="bold"><strong>typedef</strong></span> T& reference; |
---|
42 | <span class="bold"><strong>typedef</strong></span> <span class="bold"><strong>const</strong></span> T& const_reference; |
---|
43 | <span class="bold"><strong>typedef</strong></span> std::size_t size_type; |
---|
44 | <span class="bold"><strong>typedef</strong></span> std::ptrdiff_t difference_type; |
---|
45 | |
---|
46 | <span class="emphasis"><em>// static constants</em></span> |
---|
47 | <span class="bold"><strong>static</strong></span> <span class="bold"><strong>const</strong></span> size_type static_size = N; |
---|
48 | |
---|
49 | <span class="emphasis"><em>// <a href="array.html#boost.arrayconstruct-copy-destruct">construct/copy/destruct</a></em></span> |
---|
50 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> U> array& <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><U, N>&); |
---|
51 | |
---|
52 | <span class="emphasis"><em>// <a href="array.html#id2355603-bb">iterator support</a></em></span> |
---|
53 | <span class="type">iterator</span> <a href="array.html#id2355613-bb">begin</a>(); |
---|
54 | <span class="type">const_iterator</span> <a href="array.html#id2355621-bb">begin</a>() <span class="bold"><strong>const</strong></span>; |
---|
55 | <span class="type">iterator</span> <a href="array.html#id2355647-bb">end</a>(); |
---|
56 | <span class="type">const_iterator</span> <a href="array.html#id2355655-bb">end</a>() <span class="bold"><strong>const</strong></span>; |
---|
57 | |
---|
58 | <span class="emphasis"><em>// <a href="array.html#id2355679-bb">reverse iterator support</a></em></span> |
---|
59 | <span class="type">reverse_iterator</span> <a href="array.html#id2355688-bb">rbegin</a>(); |
---|
60 | <span class="type">const_reverse_iterator</span> <a href="array.html#id2355696-bb">rbegin</a>() <span class="bold"><strong>const</strong></span>; |
---|
61 | <span class="type">reverse_iterator</span> <a href="array.html#id2355718-bb">rend</a>(); |
---|
62 | <span class="type">const_reverse_iterator</span> <a href="array.html#id2355726-bb">rend</a>() <span class="bold"><strong>const</strong></span>; |
---|
63 | |
---|
64 | <span class="emphasis"><em>// <a href="array.html#id2355745-bb">capacity</a></em></span> |
---|
65 | <span class="type">size_type</span> <a href="array.html#id2355750-bb">size</a>(); |
---|
66 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2355766-bb">empty</a>(); |
---|
67 | <span class="type">size_type</span> <a href="array.html#id2365607-bb">max_size</a>(); |
---|
68 | |
---|
69 | <span class="emphasis"><em>// <a href="array.html#id2365630-bb">element access</a></em></span> |
---|
70 | <span class="type">reference</span> <a href="array.html#id2365639-bb"><span class="bold"><strong>operator</strong></span>[]</a>(size_type); |
---|
71 | <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>; |
---|
72 | <span class="type">reference</span> <a href="array.html#id2365702-bb">at</a>(size_type); |
---|
73 | <span class="type">const_reference</span> <a href="array.html#id2365720-bb">at</a>(size_type) <span class="bold"><strong>const</strong></span>; |
---|
74 | <span class="type">reference</span> <a href="array.html#id2365766-bb">front</a>(); |
---|
75 | <span class="type">const_reference</span> <a href="array.html#id2365773-bb">front</a>() <span class="bold"><strong>const</strong></span>; |
---|
76 | <span class="type">reference</span> <a href="array.html#id2365806-bb">back</a>(); |
---|
77 | <span class="type">const_reference</span> <a href="array.html#id2365814-bb">back</a>() <span class="bold"><strong>const</strong></span>; |
---|
78 | <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>; |
---|
79 | <span class="type">T*</span> <a href="array.html#id2365865-bb">c_array</a>(); |
---|
80 | |
---|
81 | <span class="emphasis"><em>// <a href="array.html#id2382978-bb">modifiers</a></em></span> |
---|
82 | <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><T, N>&); |
---|
83 | <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&); |
---|
84 | |
---|
85 | T elems[N]; |
---|
86 | }; |
---|
87 | |
---|
88 | <span class="emphasis"><em>// <a href="array.html#id2383061-bb">specialized algorithms</a></em></span> |
---|
89 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> <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><T, N>&, <a href="array.html" title="Class template array">array</a><T, N>&); |
---|
90 | |
---|
91 | <span class="emphasis"><em>// <a href="array.html#id2383136-bb">comparisons</a></em></span> |
---|
92 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
93 | <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><T, N>&, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>&); |
---|
94 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
95 | <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><T, N>&, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>&); |
---|
96 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
97 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383281"><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><T, N>&, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>&); |
---|
98 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
99 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383361"><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><T, N>&, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>&); |
---|
100 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
101 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383424"><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><T, N>&, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>&); |
---|
102 | <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
103 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a href="array.html#id2383487"><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><T, N>&, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>&);</pre></div> |
---|
104 | <div class="refsect1" lang="en"> |
---|
105 | <a name="id2573974"></a><h2>Description</h2> |
---|
106 | <div class="refsect2" lang="en"> |
---|
107 | <a name="id2573978"></a><h3> |
---|
108 | <a name="boost.arrayconstruct-copy-destruct"></a><code class="computeroutput">array</code> construct/copy/destruct</h3> |
---|
109 | <div class="orderedlist"><ol type="1"><li> |
---|
110 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> U> array& <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><U, N>& other);</pre> |
---|
111 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
112 | |
---|
113 | <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> |
---|
114 | </li></ol></div> |
---|
115 | </div> |
---|
116 | <div class="refsect2" lang="en"> |
---|
117 | <a name="id2574078"></a><h3> |
---|
118 | <a name="id2355603-bb"></a><code class="computeroutput">array</code> iterator support</h3> |
---|
119 | <div class="orderedlist"><ol type="1"> |
---|
120 | <li> |
---|
121 | <p><a name="id2355608-bb"></a></p> |
---|
122 | <pre class="literallayout"><span class="type">iterator</span> <a name="id2355613-bb"></a>begin(); |
---|
123 | <span class="type">const_iterator</span> <a name="id2355621-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre> |
---|
124 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
125 | |
---|
126 | 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>: |
---|
127 | |
---|
128 | will not throw</p> |
---|
129 | </li> |
---|
130 | <li> |
---|
131 | <p><a name="id2355642-bb"></a></p> |
---|
132 | <pre class="literallayout"><span class="type">iterator</span> <a name="id2355647-bb"></a>end(); |
---|
133 | <span class="type">const_iterator</span> <a name="id2355655-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre> |
---|
134 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
135 | |
---|
136 | 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>: |
---|
137 | |
---|
138 | will not throw</p> |
---|
139 | </li> |
---|
140 | </ol></div> |
---|
141 | </div> |
---|
142 | <div class="refsect2" lang="en"> |
---|
143 | <a name="id2574203"></a><h3> |
---|
144 | <a name="id2355679-bb"></a><code class="computeroutput">array</code> reverse iterator support</h3> |
---|
145 | <div class="orderedlist"><ol type="1"> |
---|
146 | <li> |
---|
147 | <p><a name="id2355683-bb"></a></p> |
---|
148 | <pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id2355688-bb"></a>rbegin(); |
---|
149 | <span class="type">const_reverse_iterator</span> <a name="id2355696-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre> |
---|
150 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
151 | |
---|
152 | reverse iterator for the first element of reverse iteration</p> |
---|
153 | </li> |
---|
154 | <li> |
---|
155 | <p><a name="id2355713-bb"></a></p> |
---|
156 | <pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id2355718-bb"></a>rend(); |
---|
157 | <span class="type">const_reverse_iterator</span> <a name="id2355726-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre> |
---|
158 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
159 | |
---|
160 | reverse iterator for position after the last element in reverse iteration</p> |
---|
161 | </li> |
---|
162 | </ol></div> |
---|
163 | </div> |
---|
164 | <div class="refsect2" lang="en"> |
---|
165 | <a name="id2574317"></a><h3> |
---|
166 | <a name="id2355745-bb"></a><code class="computeroutput">array</code> capacity</h3> |
---|
167 | <div class="orderedlist"><ol type="1"> |
---|
168 | <li> |
---|
169 | <pre class="literallayout"><span class="type">size_type</span> <a name="id2355750-bb"></a>size();</pre> |
---|
170 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
171 | |
---|
172 | <code class="computeroutput">N</code></p> |
---|
173 | </li> |
---|
174 | <li> |
---|
175 | <pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2355766-bb"></a>empty();</pre> |
---|
176 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
177 | |
---|
178 | <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>: |
---|
179 | |
---|
180 | will not throw</p> |
---|
181 | </li> |
---|
182 | <li> |
---|
183 | <pre class="literallayout"><span class="type">size_type</span> <a name="id2365607-bb"></a>max_size();</pre> |
---|
184 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
185 | |
---|
186 | <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>: |
---|
187 | |
---|
188 | will not throw</p> |
---|
189 | </li> |
---|
190 | </ol></div> |
---|
191 | </div> |
---|
192 | <div class="refsect2" lang="en"> |
---|
193 | <a name="id2574443"></a><h3> |
---|
194 | <a name="id2365630-bb"></a><code class="computeroutput">array</code> element access</h3> |
---|
195 | <div class="orderedlist"><ol type="1"> |
---|
196 | <li> |
---|
197 | <p><a name="id2365634-bb"></a></p> |
---|
198 | <pre class="literallayout"><span class="type">reference</span> <a name="id2365639-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type i); |
---|
199 | <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> |
---|
200 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Requires</span></b>: |
---|
201 | |
---|
202 | <code class="computeroutput">i < N</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
203 | |
---|
204 | 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>: |
---|
205 | |
---|
206 | will not throw.</p> |
---|
207 | </li> |
---|
208 | <li> |
---|
209 | <p><a name="id2365698-bb"></a></p> |
---|
210 | <pre class="literallayout"><span class="type">reference</span> <a name="id2365702-bb"></a>at(size_type i); |
---|
211 | <span class="type">const_reference</span> <a name="id2365720-bb"></a>at(size_type i) <span class="bold"><strong>const</strong></span>;</pre> |
---|
212 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
213 | |
---|
214 | 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>: |
---|
215 | |
---|
216 | <code class="computeroutput">std::range_error</code> if <code class="computeroutput">i >= N</code></p> |
---|
217 | </li> |
---|
218 | <li> |
---|
219 | <p><a name="id2365761-bb"></a></p> |
---|
220 | <pre class="literallayout"><span class="type">reference</span> <a name="id2365766-bb"></a>front(); |
---|
221 | <span class="type">const_reference</span> <a name="id2365773-bb"></a>front() <span class="bold"><strong>const</strong></span>;</pre> |
---|
222 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Requires</span></b>: |
---|
223 | |
---|
224 | <code class="computeroutput">N > 0</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
225 | |
---|
226 | the first element<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
---|
227 | |
---|
228 | will not throw</p> |
---|
229 | </li> |
---|
230 | <li> |
---|
231 | <p><a name="id2365801-bb"></a></p> |
---|
232 | <pre class="literallayout"><span class="type">reference</span> <a name="id2365806-bb"></a>back(); |
---|
233 | <span class="type">const_reference</span> <a name="id2365814-bb"></a>back() <span class="bold"><strong>const</strong></span>;</pre> |
---|
234 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Requires</span></b>: |
---|
235 | |
---|
236 | <code class="computeroutput">N > 0</code><br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
237 | |
---|
238 | the last element<br><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Throws</span></b>: |
---|
239 | |
---|
240 | will not throw</p> |
---|
241 | </li> |
---|
242 | <li> |
---|
243 | <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> |
---|
244 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
245 | |
---|
246 | <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>: |
---|
247 | |
---|
248 | will not throw</p> |
---|
249 | </li> |
---|
250 | <li> |
---|
251 | <pre class="literallayout"><span class="type">T*</span> <a name="id2365865-bb"></a>c_array();</pre> |
---|
252 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
253 | |
---|
254 | <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>: |
---|
255 | |
---|
256 | will not throw</p> |
---|
257 | </li> |
---|
258 | </ol></div> |
---|
259 | </div> |
---|
260 | <div class="refsect2" lang="en"> |
---|
261 | <a name="id2574819"></a><h3> |
---|
262 | <a name="id2382978-bb"></a><code class="computeroutput">array</code> modifiers</h3> |
---|
263 | <div class="orderedlist"><ol type="1"> |
---|
264 | <li> |
---|
265 | <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><T, N>& other);</pre> |
---|
266 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
267 | |
---|
268 | <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>: |
---|
269 | |
---|
270 | linear in <code class="computeroutput">N</code></p> |
---|
271 | </li> |
---|
272 | <li> |
---|
273 | <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& value);</pre> |
---|
274 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
275 | |
---|
276 | <code class="computeroutput">std::fill_n(<a href="array.html#id2355608-bb">begin</a>(), N, value)</code></p> |
---|
277 | </li> |
---|
278 | </ol></div> |
---|
279 | </div> |
---|
280 | <div class="refsect2" lang="en"> |
---|
281 | <a name="id2574960"></a><h3> |
---|
282 | <a name="id2383061-bb"></a><code class="computeroutput">array</code> specialized algorithms</h3> |
---|
283 | <div class="orderedlist"><ol type="1"><li> |
---|
284 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> <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><T, N>& x, <a href="array.html" title="Class template array">array</a><T, N>& y);</pre> |
---|
285 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Effects</span></b>: |
---|
286 | |
---|
287 | <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>: |
---|
288 | |
---|
289 | will not throw.</p> |
---|
290 | </li></ol></div> |
---|
291 | </div> |
---|
292 | <div class="refsect2" lang="en"> |
---|
293 | <a name="id2575053"></a><h3> |
---|
294 | <a name="id2383136-bb"></a><code class="computeroutput">array</code> comparisons</h3> |
---|
295 | <div class="orderedlist"><ol type="1"> |
---|
296 | <li> |
---|
297 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
298 | <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><T, N>& x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>& y);</pre> |
---|
299 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
300 | |
---|
301 | <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> |
---|
302 | </li> |
---|
303 | <li> |
---|
304 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
305 | <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><T, N>& x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>& y);</pre> |
---|
306 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
307 | |
---|
308 | <code class="computeroutput">!(x == y)</code></p> |
---|
309 | </li> |
---|
310 | <li> |
---|
311 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
312 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383281"></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><T, N>& x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>& y);</pre> |
---|
313 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
314 | |
---|
315 | <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> |
---|
316 | </li> |
---|
317 | <li> |
---|
318 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
319 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383361"></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><T, N>& x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>& y);</pre> |
---|
320 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
321 | |
---|
322 | <code class="computeroutput">y < x</code></p> |
---|
323 | </li> |
---|
324 | <li> |
---|
325 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
326 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383424"></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><T, N>& x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>& y);</pre> |
---|
327 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
328 | |
---|
329 | <code class="computeroutput">!(y < x)</code></p> |
---|
330 | </li> |
---|
331 | <li> |
---|
332 | <pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, std::size_t N> |
---|
333 | <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id2383487"></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><T, N>& x, <span class="bold"><strong>const</strong></span> <a href="array.html" title="Class template array">array</a><T, N>& y);</pre> |
---|
334 | <p><b xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"><span class="term">Returns</span></b>: |
---|
335 | |
---|
336 | <code class="computeroutput">!(x < y)</code></p> |
---|
337 | </li> |
---|
338 | </ol></div> |
---|
339 | </div> |
---|
340 | </div> |
---|
341 | </div> |
---|
342 | <table width="100%"><tr> |
---|
343 | <td align="left"></td> |
---|
344 | <td align="right"><small>Copyright © 2001-2004 Nicolai M. Josuttis</small></td> |
---|
345 | </tr></table> |
---|
346 | <hr> |
---|
347 | <div class="spirit-nav"> |
---|
348 | <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> |
---|
349 | </div> |
---|
350 | </body> |
---|
351 | </html> |
---|