array.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE library PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN"
  3. "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
  4. <library name="Array" dirname="array" id="array" last-revision="$Date$">
  5. <libraryinfo>
  6. <author>
  7. <firstname>Nicolai</firstname>
  8. <surname>Josuttis</surname>
  9. </author>
  10. <maintainer>
  11. <firstname>Marshall</firstname>
  12. <surname>Clow</surname>
  13. </maintainer>
  14. <copyright>
  15. <year>2001</year>
  16. <year>2002</year>
  17. <year>2003</year>
  18. <year>2004</year>
  19. <holder>Nicolai M. Josuttis</holder>
  20. </copyright>
  21. <copyright>
  22. <year>2012</year>
  23. <holder>Marshall Clow</holder>
  24. </copyright>
  25. <legalnotice>
  26. <para>Distributed under the Boost Software License, Version 1.0.
  27. (See accompanying file <filename>LICENSE_1_0.txt</filename> or copy at
  28. <ulink
  29. url="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</ulink>)
  30. </para>
  31. </legalnotice>
  32. <librarypurpose>STL compliant container wrapper for arrays of constant size</librarypurpose>
  33. <librarycategory name="category:containers"/>
  34. </libraryinfo>
  35. <title>Boost.Array</title>
  36. <section id="array.intro">
  37. <title>Introduction</title>
  38. <using-namespace name="boost"/>
  39. <using-class name="array"/>
  40. <para>The C++ Standard Template Library STL as part of the C++
  41. Standard Library provides a framework for processing algorithms on
  42. different kind of containers. However, ordinary arrays don't
  43. provide the interface of STL containers (although, they provide
  44. the iterator interface of STL containers).</para>
  45. <para>As replacement for ordinary arrays, the STL provides class
  46. <code><classname>std::vector</classname></code>. However,
  47. <code><classname>std::vector&lt;&gt;</classname></code> provides
  48. the semantics of dynamic arrays. Thus, it manages data to be able
  49. to change the number of elements. This results in some overhead in
  50. case only arrays with static size are needed.</para>
  51. <para>In his book, <emphasis>Generic Programming and the
  52. STL</emphasis>, Matthew H. Austern introduces a useful wrapper
  53. class for ordinary arrays with static size, called
  54. <code>block</code>. It is safer and has no worse performance than
  55. ordinary arrays. In <emphasis>The C++ Programming
  56. Language</emphasis>, 3rd edition, Bjarne Stroustrup introduces a
  57. similar class, called <code>c_array</code>, which I (<ulink
  58. url="http://www.josuttis.com">Nicolai Josuttis</ulink>) present
  59. slightly modified in my book <emphasis>The C++ Standard Library -
  60. A Tutorial and Reference</emphasis>, called
  61. <code>carray</code>. This is the essence of these approaches
  62. spiced with many feedback from <ulink
  63. url="http://www.boost.org">boost</ulink>.</para>
  64. <para>After considering different names, we decided to name this
  65. class simply <code><classname>array</classname></code>.</para>
  66. <para>Note that this class is suggested to be part of the next
  67. Technical Report, which will extend the C++ Standard (see
  68. <ulink url="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1548.htm">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1548.htm</ulink>).</para>
  69. <para>Update: <code>std::array</code> is (as of C++11) part of the C++ standard.
  70. The differences between <code>boost::array</code> and <code>std::array</code> are minimal.
  71. If you are using C++11, you should consider using <code>std::array</code> instead of <code>boost::array</code>.
  72. </para>
  73. <para>Class <code><classname>array</classname></code> fulfills most
  74. but not all of the requirements of "reversible containers" (see
  75. Section 23.1, [lib.container.requirements] of the C++
  76. Standard). The reasons array is not an reversible STL container is
  77. because:
  78. <itemizedlist spacing="compact">
  79. <listitem><simpara>No constructors are provided.</simpara></listitem>
  80. <listitem><simpara>Elements may have an undetermined initial value (see <xref linkend="array.rationale"/>).</simpara></listitem>
  81. <listitem><simpara><functionname>swap</functionname>() has no constant complexity.</simpara></listitem>
  82. <listitem><simpara><methodname>size</methodname>() is always constant, based on the second template argument of the type.</simpara></listitem>
  83. <listitem><simpara>The container provides no allocator support.</simpara></listitem>
  84. </itemizedlist>
  85. </para>
  86. <para>It doesn't fulfill the requirements of a "sequence" (see Section 23.1.1, [lib.sequence.reqmts] of the C++ Standard), except that:
  87. <itemizedlist spacing="compact">
  88. <listitem><simpara><methodname>front</methodname>() and <methodname>back</methodname>() are provided.</simpara></listitem>
  89. <listitem><simpara><methodname>operator[]</methodname> and <methodname>at</methodname>() are provided.</simpara></listitem>
  90. </itemizedlist>
  91. </para>
  92. </section>
  93. <library-reference>
  94. <header name="boost/array.hpp">
  95. <namespace name="boost">
  96. <class name="array">
  97. <template>
  98. <template-type-parameter name="T"/>
  99. <template-nontype-parameter name="N">
  100. <type>std::size_t</type>
  101. </template-nontype-parameter>
  102. </template>
  103. <purpose><para>STL compliant container wrapper for arrays of constant size</para></purpose>
  104. <typedef name="value_type">
  105. <type>T</type>
  106. </typedef>
  107. <typedef name="iterator">
  108. <type>T*</type>
  109. </typedef>
  110. <typedef name="const_iterator">
  111. <type>const T*</type>
  112. </typedef>
  113. <typedef name="reverse_iterator">
  114. <type><classname>std::reverse_iterator</classname>&lt;iterator&gt;</type>
  115. </typedef>
  116. <typedef name="const_reverse_iterator">
  117. <type><classname>std::reverse_iterator</classname>&lt;const_iterator&gt;</type>
  118. </typedef>
  119. <typedef name="reference">
  120. <type>T&amp;</type>
  121. </typedef>
  122. <typedef name="const_reference">
  123. <type>const T&amp;</type>
  124. </typedef>
  125. <typedef name="size_type">
  126. <type>std::size_t</type>
  127. </typedef>
  128. <typedef name="difference_type">
  129. <type>std::ptrdiff_t</type>
  130. </typedef>
  131. <static-constant name="static_size">
  132. <type>size_type</type>
  133. <default>N</default>
  134. </static-constant>
  135. <copy-assignment>
  136. <template>
  137. <template-type-parameter name="U"/>
  138. </template>
  139. <parameter name="other">
  140. <paramtype>const <classname>array</classname>&lt;U, N&gt;&amp;</paramtype>
  141. </parameter>
  142. <effects><simpara><code>std::copy(rhs.<methodname>begin</methodname>(),rhs.<methodname>end</methodname>(), <methodname>begin</methodname>())</code></simpara></effects>
  143. </copy-assignment>
  144. <method-group name="iterator support">
  145. <overloaded-method name="begin">
  146. <signature>
  147. <type>iterator</type>
  148. </signature>
  149. <signature cv="const">
  150. <type>const_iterator</type>
  151. </signature>
  152. <returns><simpara>iterator for the first element</simpara></returns>
  153. <throws><simpara>will not throw</simpara></throws>
  154. </overloaded-method>
  155. <overloaded-method name="end">
  156. <signature>
  157. <type>iterator</type>
  158. </signature>
  159. <signature cv="const">
  160. <type>const_iterator</type>
  161. </signature>
  162. <returns><simpara>iterator for position after the last element</simpara></returns>
  163. <throws><simpara>will not throw</simpara></throws>
  164. </overloaded-method>
  165. <overloaded-method name="cbegin" cv="const">
  166. <signature>
  167. <type>const_iterator</type>
  168. </signature>
  169. <returns><simpara>constant iterator for the first element</simpara></returns>
  170. <throws><simpara>will not throw</simpara></throws>
  171. </overloaded-method>
  172. <overloaded-method name="cend" cv="const">
  173. <signature>
  174. <type>const_iterator</type>
  175. </signature>
  176. <returns><simpara>constant iterator for position after the last element</simpara></returns>
  177. <throws><simpara>will not throw</simpara></throws>
  178. </overloaded-method>
  179. </method-group>
  180. <method-group name="reverse iterator support">
  181. <overloaded-method name="rbegin">
  182. <signature>
  183. <type>reverse_iterator</type>
  184. </signature>
  185. <signature cv="const">
  186. <type>const_reverse_iterator</type>
  187. </signature>
  188. <returns><simpara>reverse iterator for the first element of reverse iteration</simpara></returns>
  189. </overloaded-method>
  190. <overloaded-method name="rend">
  191. <signature>
  192. <type>reverse_iterator</type>
  193. </signature>
  194. <signature cv="const">
  195. <type>const_reverse_iterator</type>
  196. </signature>
  197. <returns><simpara>reverse iterator for position after the last element in reverse iteration</simpara></returns>
  198. </overloaded-method>
  199. <overloaded-method name="crbegin" cv="const">
  200. <signature>
  201. <type>const_reverse_iterator</type>
  202. </signature>
  203. <returns><simpara>constant reverse iterator for the first element of reverse iteration</simpara></returns>
  204. <throws><simpara>will not throw</simpara></throws>
  205. </overloaded-method>
  206. <overloaded-method name="crend" cv="const">
  207. <signature>
  208. <type>const_reverse_iterator</type>
  209. </signature>
  210. <returns><simpara>constant reverse iterator for position after the last element in reverse iteration</simpara></returns>
  211. <throws><simpara>will not throw</simpara></throws>
  212. </overloaded-method>
  213. </method-group>
  214. <method-group name="capacity">
  215. <method name="size">
  216. <type>size_type</type>
  217. <returns><simpara><code>N</code></simpara></returns>
  218. </method>
  219. <method name="empty">
  220. <type>bool</type>
  221. <returns><simpara><code>N==0</code></simpara></returns>
  222. <throws><simpara>will not throw</simpara></throws>
  223. </method>
  224. <method name="max_size">
  225. <type>size_type</type>
  226. <returns><simpara><code>N</code></simpara></returns>
  227. <throws><simpara>will not throw</simpara></throws>
  228. </method>
  229. </method-group>
  230. <method-group name="element access">
  231. <overloaded-method name="operator[]">
  232. <signature>
  233. <type>reference</type>
  234. <parameter name="i">
  235. <paramtype>size_type</paramtype>
  236. </parameter>
  237. </signature>
  238. <signature cv="const">
  239. <type>const_reference</type>
  240. <parameter name="i">
  241. <paramtype>size_type</paramtype>
  242. </parameter>
  243. </signature>
  244. <requires><simpara><code>i &lt; N</code></simpara></requires>
  245. <returns><simpara>element with index <code>i</code></simpara></returns>
  246. <throws><simpara>will not throw.</simpara></throws>
  247. </overloaded-method>
  248. <overloaded-method name="at">
  249. <signature>
  250. <type>reference</type>
  251. <parameter name="i">
  252. <paramtype>size_type</paramtype>
  253. </parameter>
  254. </signature>
  255. <signature cv="const">
  256. <type>const_reference</type>
  257. <parameter name="i">
  258. <paramtype>size_type</paramtype>
  259. </parameter>
  260. </signature>
  261. <returns><simpara>element with index <code>i</code></simpara></returns>
  262. <throws><simpara><code><classname>std::range_error</classname></code> if <code>i &gt;= N</code></simpara></throws>
  263. </overloaded-method>
  264. <overloaded-method name="front">
  265. <signature>
  266. <type>reference</type>
  267. </signature>
  268. <signature cv="const">
  269. <type>const_reference</type>
  270. </signature>
  271. <requires><simpara><code>N &gt; 0</code></simpara></requires>
  272. <returns><simpara>the first element</simpara></returns>
  273. <throws><simpara>will not throw</simpara></throws>
  274. </overloaded-method>
  275. <overloaded-method name="back">
  276. <signature>
  277. <type>reference</type>
  278. </signature>
  279. <signature cv="const">
  280. <type>const_reference</type>
  281. </signature>
  282. <requires><simpara><code>N &gt; 0</code></simpara></requires>
  283. <returns><simpara>the last element</simpara></returns>
  284. <throws><simpara>will not throw</simpara></throws>
  285. </overloaded-method>
  286. <method name="data" cv="const">
  287. <type>const T*</type>
  288. <returns><simpara><code>elems</code></simpara></returns>
  289. <throws><simpara>will not throw</simpara></throws>
  290. </method>
  291. <method name="c_array">
  292. <type>T*</type>
  293. <returns><simpara><code>elems</code></simpara></returns>
  294. <throws><simpara>will not throw</simpara></throws>
  295. </method>
  296. </method-group>
  297. <method-group name="modifiers">
  298. <method name="swap">
  299. <type>void</type>
  300. <parameter name="other">
  301. <paramtype><classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  302. </parameter>
  303. <effects><simpara><code>std::swap_ranges(<methodname>begin</methodname>(), <methodname>end</methodname>(), other.<methodname>begin</methodname>())</code></simpara></effects>
  304. <complexity><simpara>linear in <code>N</code></simpara></complexity>
  305. </method>
  306. <method name="assign">
  307. <type>void</type>
  308. <parameter name="value">
  309. <paramtype>const T&amp;</paramtype>
  310. </parameter>
  311. <effects><simpara><code>std::fill_n(<methodname>begin</methodname>(), N, value)</code></simpara></effects>
  312. </method>
  313. </method-group>
  314. <data-member name="elems[N]"> <!-- HACK -->
  315. <type>T</type>
  316. </data-member>
  317. <free-function-group name="specialized algorithms">
  318. <function name="swap">
  319. <template>
  320. <template-type-parameter name="T"/>
  321. <template-nontype-parameter name="N">
  322. <type>std::size_t</type>
  323. </template-nontype-parameter>
  324. </template>
  325. <type>void</type>
  326. <parameter name="x">
  327. <paramtype><classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  328. </parameter>
  329. <parameter name="y">
  330. <paramtype><classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  331. </parameter>
  332. <effects><simpara><code>x.<methodname>swap</methodname>(y)</code></simpara></effects>
  333. <throws><simpara>will not throw.</simpara></throws>
  334. </function>
  335. </free-function-group>
  336. <free-function-group name="comparisons">
  337. <function name="operator==">
  338. <template>
  339. <template-type-parameter name="T"/>
  340. <template-nontype-parameter name="N">
  341. <type>std::size_t</type>
  342. </template-nontype-parameter>
  343. </template>
  344. <type>bool</type>
  345. <parameter name="x">
  346. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  347. </parameter>
  348. <parameter name="y">
  349. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  350. </parameter>
  351. <returns><simpara><code>std::equal(x.<methodname>begin</methodname>(), x.<methodname>end</methodname>(), y.<methodname>begin</methodname>())</code></simpara>
  352. </returns>
  353. </function>
  354. <function name="operator!=">
  355. <template>
  356. <template-type-parameter name="T"/>
  357. <template-nontype-parameter name="N">
  358. <type>std::size_t</type>
  359. </template-nontype-parameter>
  360. </template>
  361. <type>bool</type>
  362. <parameter name="x">
  363. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  364. </parameter>
  365. <parameter name="y">
  366. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  367. </parameter>
  368. <returns><simpara><code>!(x == y)</code></simpara>
  369. </returns>
  370. </function>
  371. <function name="operator&lt;">
  372. <template>
  373. <template-type-parameter name="T"/>
  374. <template-nontype-parameter name="N">
  375. <type>std::size_t</type>
  376. </template-nontype-parameter>
  377. </template>
  378. <type>bool</type>
  379. <parameter name="x">
  380. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  381. </parameter>
  382. <parameter name="y">
  383. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  384. </parameter>
  385. <returns><simpara><code>std::lexicographical_compare(x.<methodname>begin</methodname>(), x.<methodname>end</methodname>(), y.<methodname>begin</methodname>(), y.<methodname>end</methodname>())</code></simpara>
  386. </returns>
  387. </function>
  388. <function name="operator&gt;">
  389. <template>
  390. <template-type-parameter name="T"/>
  391. <template-nontype-parameter name="N">
  392. <type>std::size_t</type>
  393. </template-nontype-parameter>
  394. </template>
  395. <type>bool</type>
  396. <parameter name="x">
  397. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  398. </parameter>
  399. <parameter name="y">
  400. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  401. </parameter>
  402. <returns><simpara><code>y &lt; x</code></simpara></returns>
  403. </function>
  404. <function name="operator&lt;=">
  405. <template>
  406. <template-type-parameter name="T"/>
  407. <template-nontype-parameter name="N">
  408. <type>std::size_t</type>
  409. </template-nontype-parameter>
  410. </template>
  411. <type>bool</type>
  412. <parameter name="x">
  413. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  414. </parameter>
  415. <parameter name="y">
  416. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  417. </parameter>
  418. <returns><simpara><code>!(y &lt; x)</code></simpara></returns>
  419. </function>
  420. <function name="operator&gt;=">
  421. <template>
  422. <template-type-parameter name="T"/>
  423. <template-nontype-parameter name="N">
  424. <type>std::size_t</type>
  425. </template-nontype-parameter>
  426. </template>
  427. <type>bool</type>
  428. <parameter name="x">
  429. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  430. </parameter>
  431. <parameter name="y">
  432. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  433. </parameter>
  434. <returns><simpara><code>!(x &lt; y)</code></simpara></returns>
  435. </function>
  436. </free-function-group>
  437. <free-function-group name="specializations">
  438. <function name="boost::get">
  439. <template>
  440. <template-type-parameter name="T"/>
  441. <template-nontype-parameter name="N">
  442. <type>std::size_t</type>
  443. </template-nontype-parameter>
  444. <template-nontype-parameter name="Idx">
  445. <type>std::size_t</type>
  446. </template-nontype-parameter>
  447. </template>
  448. <type>T</type>
  449. <parameter name="arr">
  450. <paramtype><classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  451. </parameter>
  452. <returns><simpara>element of array with index <code>Idx</code></simpara></returns>
  453. <effects><simpara>Will <code>static_assert</code> if <code>Idx >= N</code></simpara></effects>
  454. </function>
  455. <function name="boost::get">
  456. <template>
  457. <template-type-parameter name="T"/>
  458. <template-nontype-parameter name="N">
  459. <type>std::size_t</type>
  460. </template-nontype-parameter>
  461. <template-nontype-parameter name="Idx">
  462. <type>std::size_t</type>
  463. </template-nontype-parameter>
  464. </template>
  465. <type>T</type>
  466. <parameter name="arr">
  467. <paramtype>const <classname>array</classname>&lt;T, N&gt;&amp;</paramtype>
  468. </parameter>
  469. <returns><simpara>const element of array with index <code>Idx</code></simpara></returns>
  470. <effects><simpara>Will <code>static_assert</code> if <code>Idx >= N</code></simpara></effects>
  471. </function>
  472. </free-function-group>
  473. </class>
  474. </namespace>
  475. </header>
  476. </library-reference>
  477. <section id="array.rationale">
  478. <title>Design Rationale</title>
  479. <para>There was an important design tradeoff regarding the
  480. constructors: We could implement array as an "aggregate" (see
  481. Section 8.5.1, [dcl.init.aggr], of the C++ Standard). This would
  482. mean:
  483. <itemizedlist>
  484. <listitem><simpara>An array can be initialized with a
  485. brace-enclosing, comma-separated list of initializers for the
  486. elements of the container, written in increasing subscript
  487. order:</simpara>
  488. <programlisting><classname>boost::array</classname>&lt;int,4&gt; a = { { 1, 2, 3 } };</programlisting>
  489. <simpara>Note that if there are fewer elements in the
  490. initializer list, then each remaining element gets
  491. default-initialized (thus, it has a defined value).</simpara>
  492. </listitem></itemizedlist></para>
  493. <para>However, this approach has its drawbacks: <emphasis
  494. role="bold"> passing no initializer list means that the elements
  495. have an indetermined initial value</emphasis>, because the rule says
  496. that aggregates may have:
  497. <itemizedlist>
  498. <listitem><simpara>No user-declared constructors.</simpara></listitem>
  499. <listitem><simpara>No private or protected non-static data members.</simpara></listitem>
  500. <listitem><simpara>No base classes.</simpara></listitem>
  501. <listitem><simpara>No virtual functions.</simpara></listitem>
  502. </itemizedlist>
  503. </para>
  504. <para>Nevertheless, The current implementation uses this approach.</para>
  505. <para>Note that for standard conforming compilers it is possible to
  506. use fewer braces (according to 8.5.1 (11) of the Standard). That is,
  507. you can initialize an array as follows:</para>
  508. <programlisting>
  509. <classname>boost::array</classname>&lt;int,4&gt; a = { 1, 2, 3 };
  510. </programlisting>
  511. <para>I'd appreciate any constructive feedback. <emphasis
  512. role="bold">Please note: I don't have time to read all boost
  513. mails. Thus, to make sure that feedback arrives to me, please send
  514. me a copy of each mail regarding this class.</emphasis></para>
  515. <para>The code is provided "as is" without expressed or implied
  516. warranty.</para>
  517. </section>
  518. <section id="array.more.info">
  519. <title>For more information...</title>
  520. <para>To find more details about using ordinary arrays in C++ and
  521. the framework of the STL, see e.g.
  522. <literallayout>The C++ Standard Library - A Tutorial and Reference
  523. by Nicolai M. Josuttis
  524. Addison Wesley Longman, 1999
  525. ISBN 0-201-37926-0</literallayout>
  526. </para>
  527. <para><ulink url="http://www.josuttis.com/">Home Page of Nicolai
  528. Josuttis</ulink></para>
  529. </section>
  530. <section id="array.ack">
  531. <title>Acknowledgements</title>
  532. <para>Doug Gregor ported the documentation to the BoostBook format.</para>
  533. </section>
  534. <!-- Notes:
  535. empty() should return N != 0
  536. size(), empty(), max_size() should be const
  537. -->
  538. </library>