ref.php 83 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788
  1. <?php
  2. function echo_unordered_docs(
  3. $map,
  4. $equivalent_keys)
  5. {
  6. $name = 'unordered_'.
  7. ($equivalent_keys ? 'multi' : '').
  8. ($map ? 'map' : 'set');
  9. // For merge....
  10. $node_partner = 'unordered_'.
  11. ($equivalent_keys ? '' : 'multi').
  12. ($map ? 'map' : 'set');
  13. if ($map)
  14. {
  15. $template_value = <<<EOL
  16. <template-type-parameter name="Key">
  17. </template-type-parameter>
  18. <template-type-parameter name="Mapped">
  19. </template-type-parameter>
  20. EOL;
  21. $key_type = 'Key';
  22. $key_name = 'key';
  23. $value_type = 'std::pair&lt;Key const, Mapped&gt;';
  24. $full_type = $name.'&lt;Key, Mapped, Hash, Pred, Alloc&gt;';
  25. }
  26. else
  27. {
  28. $template_value = <<<EOL
  29. <template-type-parameter name="Value">
  30. </template-type-parameter>
  31. EOL;
  32. $key_type = 'Value';
  33. $key_name = 'value';
  34. $value_type = 'Value';
  35. $full_type = $name.'&lt;Value, Hash, Pred, Alloc&gt;';
  36. }
  37. ?>
  38. <class name="<?php echo $name ?>">
  39. <template>
  40. <?php echo $template_value; ?>
  41. <template-type-parameter name="Hash">
  42. <default><type>boost::hash&lt;<?php echo $key_type; ?>&gt;</type></default>
  43. </template-type-parameter>
  44. <template-type-parameter name="Pred">
  45. <default><type>std::equal_to&lt;<?php echo $key_type; ?>&gt;</type></default>
  46. </template-type-parameter>
  47. <template-type-parameter name="Alloc">
  48. <default><type>std::allocator&lt;<?php echo $value_type; ?>&gt;</type></default>
  49. </template-type-parameter>
  50. </template>
  51. <purpose><simpara>
  52. An unordered associative container that <?php
  53. echo $map ? 'associates ' : 'stores ';
  54. echo $equivalent_keys ? '' : 'unique ';
  55. echo $map ? 'keys with another value.' : 'values.';
  56. echo $equivalent_keys ? ' The same key can be stored multiple times.' : '';
  57. ?>
  58. </simpara></purpose>
  59. <description>
  60. <para><emphasis role="bold">Template Parameters</emphasis>
  61. <informaltable>
  62. <tgroup cols="2">
  63. <tbody>
  64. <?php if ($map): ?>
  65. <row>
  66. <entry><emphasis>Key</emphasis></entry>
  67. <entry><code>Key</code> must be <code>Erasable</code> from the container
  68. (i.e. <code>allocator_traits</code> can <code>destroy</code> it).
  69. </entry></row>
  70. <row>
  71. <entry><emphasis>Mapped</emphasis></entry>
  72. <entry><code>Mapped</code> must be <code>Erasable</code> from the container
  73. (i.e. <code>allocator_traits</code> can <code>destroy</code> it).
  74. </entry></row>
  75. <?php else: ?>
  76. <row>
  77. <entry><emphasis>Value</emphasis></entry>
  78. <entry><code>Value</code> must be <code>Erasable</code> from the container
  79. (i.e. <code>allocator_traits</code> can <code>destroy</code> it).
  80. </entry></row>
  81. <?php endif ?>
  82. <row>
  83. <entry><emphasis>Hash</emphasis></entry>
  84. <entry>A unary function object type that acts a hash function for a <code><?php echo $key_type; ?></code>. It takes a single argument of type <code><?php echo $key_type; ?></code> and returns a value of type std::size_t.</entry></row>
  85. <row>
  86. <entry><emphasis>Pred</emphasis></entry>
  87. <entry>A binary function object that implements an equivalence relation on values of type <code><?php echo $key_type; ?></code>.
  88. A binary function object that induces an equivalence relation on values of type <code><?php echo $key_type; ?></code>.
  89. It takes two arguments of type <code><?php echo $key_type; ?></code> and returns a value of type bool.</entry></row>
  90. <row>
  91. <entry><emphasis>Alloc</emphasis></entry>
  92. <entry>An allocator whose value type is the same as the container's value type.</entry></row></tbody></tgroup></informaltable></para>
  93. <para>The elements are organized into buckets. <?php
  94. echo $equivalent_keys ?
  95. 'Keys with the same hash code are stored in the same bucket and elements with equivalent keys are stored next to each other.' :
  96. 'Keys with the same hash code are stored in the same bucket.';
  97. ?></para>
  98. <para>The number of buckets can be automatically increased by a call to insert, or as the result of calling rehash.</para>
  99. </description>
  100. <typedef name="key_type">
  101. <type><?php echo $key_type; ?></type>
  102. </typedef>
  103. <typedef name="value_type">
  104. <type><?php echo $value_type; ?></type>
  105. </typedef>
  106. <?php if ($map): ?>
  107. <typedef name="mapped_type">
  108. <type>Mapped</type>
  109. </typedef>
  110. <?php endif; ?>
  111. <typedef name="hasher">
  112. <type>Hash</type>
  113. </typedef>
  114. <typedef name="key_equal">
  115. <type>Pred</type>
  116. </typedef>
  117. <typedef name="allocator_type">
  118. <type>Alloc</type>
  119. </typedef>
  120. <typedef name="pointer">
  121. <type>typename allocator_type::pointer</type>
  122. <description>
  123. <para>
  124. <code>value_type*</code> if
  125. <code>allocator_type::pointer</code> is not defined.
  126. </para>
  127. </description>
  128. </typedef>
  129. <typedef name="const_pointer">
  130. <type>typename allocator_type::const_pointer</type>
  131. <description>
  132. <para>
  133. <code>boost::pointer_to_other&lt;pointer, value_type&gt;::type</code>
  134. if <code>allocator_type::const_pointer</code> is not defined.
  135. </para>
  136. </description>
  137. </typedef>
  138. <typedef name="reference">
  139. <type>value_type&amp;</type>
  140. <purpose><simpara>lvalue of <type>value_type</type>.</simpara></purpose>
  141. </typedef>
  142. <typedef name="const_reference">
  143. <type>value_type const&amp;</type>
  144. <purpose><simpara>const lvalue of <type>value_type</type>.</simpara></purpose>
  145. </typedef>
  146. <typedef name="size_type">
  147. <type><emphasis>implementation-defined</emphasis></type>
  148. <description>
  149. <para>An unsigned integral type.</para>
  150. <para><type>size_type</type> can represent any non-negative value of <type>difference_type</type>.</para>
  151. </description>
  152. </typedef>
  153. <typedef name="difference_type">
  154. <type><emphasis>implementation-defined</emphasis></type>
  155. <description>
  156. <para>A signed integral type.</para>
  157. <para>Is identical to the difference type of <type>iterator</type> and <type>const_iterator</type>.</para>
  158. </description>
  159. </typedef>
  160. <typedef name="iterator">
  161. <type><emphasis>implementation-defined</emphasis></type>
  162. <description>
  163. <para><?php echo $map ? 'An' : 'A constant' ?> iterator whose value type is <type>value_type</type>. </para>
  164. <para>The iterator category is at least a forward iterator.</para>
  165. <para>Convertible to <type>const_iterator</type>.</para>
  166. </description>
  167. </typedef>
  168. <typedef name="const_iterator">
  169. <type><emphasis>implementation-defined</emphasis></type>
  170. <description>
  171. <para>A constant iterator whose value type is <type>value_type</type>. </para>
  172. <para>The iterator category is at least a forward iterator.</para>
  173. </description>
  174. </typedef>
  175. <typedef name="local_iterator">
  176. <type><emphasis>implementation-defined</emphasis></type>
  177. <description>
  178. <para>An iterator with the same value type, difference type and pointer and reference type as <type>iterator</type>.</para>
  179. <para>A local_iterator object can be used to iterate through a single bucket.</para>
  180. </description>
  181. </typedef>
  182. <typedef name="const_local_iterator">
  183. <type><emphasis>implementation-defined</emphasis></type>
  184. <description>
  185. <para>A constant iterator with the same value type, difference type and pointer and reference type as <type>const_iterator</type>.</para>
  186. <para>A const_local_iterator object can be used to iterate through a single bucket.</para>
  187. </description>
  188. </typedef>
  189. <typedef name="node_type">
  190. <type><emphasis>implementation-defined</emphasis></type>
  191. <description>
  192. <para>See <classname>node_handle_<?php echo $map ? 'map' : 'set'; ?></classname> for details.</para>
  193. </description>
  194. </typedef>
  195. <?php if (!$equivalent_keys): ?>
  196. <typedef name="insert_return_type">
  197. <type><emphasis>implementation-defined</emphasis></type>
  198. <description>
  199. Structure returned by inserting <code>node_type</code>.
  200. </description>
  201. </typedef>
  202. <?php endif; ?>
  203. <constructor>
  204. <postconditions>
  205. <code><methodname>size</methodname>() == 0</code>
  206. </postconditions>
  207. <description>
  208. <para>Constructs an empty container using hasher() as the hash function, key_equal() as the key equality predicate, allocator_type() as the allocator and a maximum load factor of 1.0.</para>
  209. </description>
  210. <requires>
  211. <para>If the defaults are used, <code>hasher</code>, <code>key_equal</code> and
  212. <code>allocator_type</code> need to be <code>DefaultConstructible</code>.
  213. </para>
  214. </requires>
  215. </constructor>
  216. <constructor specifiers="explicit">
  217. <parameter name="n">
  218. <paramtype>size_type</paramtype>
  219. </parameter>
  220. <parameter name="hf">
  221. <paramtype>hasher const&amp;</paramtype>
  222. <default>hasher()</default>
  223. </parameter>
  224. <parameter name="eq">
  225. <paramtype>key_equal const&amp;</paramtype>
  226. <default>key_equal()</default>
  227. </parameter>
  228. <parameter name="a">
  229. <paramtype>allocator_type const&amp;</paramtype>
  230. <default>allocator_type()</default>
  231. </parameter>
  232. <postconditions>
  233. <code><methodname>size</methodname>() == 0</code>
  234. </postconditions>
  235. <description>
  236. <para>Constructs an empty container with at least n buckets, using hf as the hash function, eq as the key equality predicate, a as the allocator and a maximum load factor of 1.0.</para>
  237. </description>
  238. <requires>
  239. <para>If the defaults are used, <code>hasher</code>, <code>key_equal</code> and
  240. <code>allocator_type</code> need to be <code>DefaultConstructible</code>.
  241. </para>
  242. </requires>
  243. </constructor>
  244. <constructor>
  245. <template>
  246. <template-type-parameter name="InputIterator">
  247. </template-type-parameter>
  248. </template>
  249. <parameter name="f">
  250. <paramtype>InputIterator</paramtype>
  251. </parameter>
  252. <parameter name="l">
  253. <paramtype>InputIterator</paramtype>
  254. </parameter>
  255. <parameter name="n">
  256. <paramtype>size_type</paramtype>
  257. <default><emphasis>implementation-defined</emphasis></default>
  258. </parameter>
  259. <parameter name="hf">
  260. <paramtype>hasher const&amp;</paramtype>
  261. <default>hasher()</default>
  262. </parameter>
  263. <parameter name="eq">
  264. <paramtype>key_equal const&amp;</paramtype>
  265. <default>key_equal()</default>
  266. </parameter>
  267. <parameter name="a">
  268. <paramtype>allocator_type const&amp;</paramtype>
  269. <default>allocator_type()</default>
  270. </parameter>
  271. <description>
  272. <para>Constructs an empty container with at least <code>n</code> buckets,
  273. using <code>hf</code> as the hash function,
  274. <code>eq</code> as the key equality predicate,
  275. <code>a</code> as the allocator and a maximum load factor of 1.0
  276. and inserts the elements from [f, l) into it.
  277. </para>
  278. </description>
  279. <requires>
  280. <para>If the defaults are used, <code>hasher</code>, <code>key_equal</code> and
  281. <code>allocator_type</code> need to be <code>DefaultConstructible</code>.
  282. </para>
  283. </requires>
  284. </constructor>
  285. <constructor>
  286. <parameter>
  287. <paramtype><?php echo $name; ?> const&amp;</paramtype>
  288. </parameter>
  289. <description>
  290. <para>The copy constructor. Copies the contained elements, hash function, predicate, maximum load factor and allocator.</para>
  291. <para>If <code>Allocator::select_on_container_copy_construction</code>
  292. exists and has the right signature, the allocator will be
  293. constructed from its result.</para>
  294. </description>
  295. <requires>
  296. <para><code>value_type</code> is copy constructible</para>
  297. </requires>
  298. </constructor>
  299. <constructor>
  300. <parameter>
  301. <paramtype><?php echo $name; ?> &amp;&amp;</paramtype>
  302. </parameter>
  303. <description>
  304. <para>The move constructor.</para>
  305. </description>
  306. <notes>
  307. <para>This is implemented using Boost.Move.</para>
  308. </notes>
  309. <requires>
  310. <para>
  311. <code>value_type</code> is move constructible.
  312. </para>
  313. <para>
  314. On compilers without rvalue reference support the
  315. emulation does not support moving without calling
  316. <code>boost::move</code> if <code>value_type</code> is
  317. not copyable. So, for example, you can't return the
  318. container from a function.
  319. </para>
  320. </requires>
  321. </constructor>
  322. <constructor specifiers="explicit">
  323. <parameter name="a">
  324. <paramtype>Allocator const&amp;</paramtype>
  325. </parameter>
  326. <description>
  327. <para>Constructs an empty container, using allocator <code>a</code>.</para>
  328. </description>
  329. </constructor>
  330. <constructor>
  331. <parameter name="x">
  332. <paramtype><?php echo $name; ?> const&amp;</paramtype>
  333. </parameter>
  334. <parameter name="a">
  335. <paramtype>Allocator const&amp;</paramtype>
  336. </parameter>
  337. <description>
  338. <para>Constructs an container, copying <code>x</code>'s contained elements, hash function, predicate, maximum load factor, but using allocator <code>a</code>.</para>
  339. </description>
  340. </constructor>
  341. <constructor>
  342. <parameter name="x">
  343. <paramtype><?php echo $name; ?> &amp;&amp;</paramtype>
  344. </parameter>
  345. <parameter name="a">
  346. <paramtype>Allocator const&amp;</paramtype>
  347. </parameter>
  348. <description>
  349. <para>Construct a container moving <code>x</code>'s contained elements, and having the hash function, predicate and maximum load factor, but using allocate <code>a</code>.</para>
  350. </description>
  351. <notes>
  352. <para>This is implemented using Boost.Move.</para>
  353. </notes>
  354. <requires>
  355. <para>
  356. <code>value_type</code> is move insertable.
  357. </para>
  358. </requires>
  359. </constructor>
  360. <constructor>
  361. <parameter name="il">
  362. <paramtype>initializer_list&lt;value_type&gt;</paramtype>
  363. </parameter>
  364. <parameter name="n">
  365. <paramtype>size_type</paramtype>
  366. <default><emphasis>implementation-defined</emphasis></default>
  367. </parameter>
  368. <parameter name="hf">
  369. <paramtype>hasher const&amp;</paramtype>
  370. <default>hasher()</default>
  371. </parameter>
  372. <parameter name="eq">
  373. <paramtype>key_equal const&amp;</paramtype>
  374. <default>key_equal()</default>
  375. </parameter>
  376. <parameter name="a">
  377. <paramtype>allocator_type const&amp;</paramtype>
  378. <default>allocator_type()</default>
  379. </parameter>
  380. <description>
  381. <para>Constructs an empty container with at least <code>n</code> buckets,
  382. using <code>hf</code> as the hash function,
  383. <code>eq</code> as the key equality predicate,
  384. <code>a</code> as the allocator and a maximum load factor of 1.0
  385. and inserts the elements from <code>il</code> into it.
  386. </para>
  387. </description>
  388. <requires>
  389. <para>If the defaults are used, <code>hasher</code>, <code>key_equal</code> and
  390. <code>allocator_type</code> need to be <code>DefaultConstructible</code>.
  391. </para>
  392. </requires>
  393. </constructor>
  394. <constructor>
  395. <parameter name="n">
  396. <paramtype>size_type</paramtype>
  397. </parameter>
  398. <parameter name="a">
  399. <paramtype>allocator_type const&amp;</paramtype>
  400. </parameter>
  401. <postconditions>
  402. <code><methodname>size</methodname>() == 0</code>
  403. </postconditions>
  404. <description>
  405. <para>Constructs an empty container with at least <code>n</code> buckets,
  406. using <code>hf</code> as the hash function,
  407. the default hash function and key equality predicate,
  408. <code>a</code> as the allocator and a maximum load factor of 1.0.</para>
  409. </description>
  410. <requires>
  411. <para><code>hasher</code> and <code>key_equal</code> need to be <code>DefaultConstructible</code>.
  412. </para>
  413. </requires>
  414. </constructor>
  415. <constructor>
  416. <parameter name="n">
  417. <paramtype>size_type</paramtype>
  418. </parameter>
  419. <parameter name="hf">
  420. <paramtype>hasher const&amp;</paramtype>
  421. </parameter>
  422. <parameter name="a">
  423. <paramtype>allocator_type const&amp;</paramtype>
  424. </parameter>
  425. <postconditions>
  426. <code><methodname>size</methodname>() == 0</code>
  427. </postconditions>
  428. <description>
  429. <para>Constructs an empty container with at least <code>n</code> buckets,
  430. using <code>hf</code> as the hash function,
  431. the default key equality predicate,
  432. <code>a</code> as the allocator and a maximum load factor of 1.0.</para>
  433. </description>
  434. <requires>
  435. <para><code>key_equal</code> needs to be <code>DefaultConstructible</code>.
  436. </para>
  437. </requires>
  438. </constructor>
  439. <constructor>
  440. <template>
  441. <template-type-parameter name="InputIterator">
  442. </template-type-parameter>
  443. </template>
  444. <parameter name="f">
  445. <paramtype>InputIterator</paramtype>
  446. </parameter>
  447. <parameter name="l">
  448. <paramtype>InputIterator</paramtype>
  449. </parameter>
  450. <parameter name="n">
  451. <paramtype>size_type</paramtype>
  452. </parameter>
  453. <parameter name="a">
  454. <paramtype>allocator_type const&amp;</paramtype>
  455. </parameter>
  456. <description>
  457. <para>Constructs an empty container with at least <code>n</code> buckets,
  458. using <code>a</code> as the allocator, with the
  459. default hash function and key equality predicate
  460. and a maximum load factor of 1.0
  461. and inserts the elements from [f, l) into it.
  462. </para>
  463. </description>
  464. <requires>
  465. <para><code>hasher</code>, <code>key_equal</code> need to be <code>DefaultConstructible</code>.
  466. </para>
  467. </requires>
  468. </constructor>
  469. <constructor>
  470. <template>
  471. <template-type-parameter name="InputIterator">
  472. </template-type-parameter>
  473. </template>
  474. <parameter name="f">
  475. <paramtype>InputIterator</paramtype>
  476. </parameter>
  477. <parameter name="l">
  478. <paramtype>InputIterator</paramtype>
  479. </parameter>
  480. <parameter name="n">
  481. <paramtype>size_type</paramtype>
  482. </parameter>
  483. <parameter name="hf">
  484. <paramtype>hasher const&amp;</paramtype>
  485. </parameter>
  486. <parameter name="a">
  487. <paramtype>allocator_type const&amp;</paramtype>
  488. </parameter>
  489. <description>
  490. <para>Constructs an empty container with at least <code>n</code> buckets,
  491. using <code>hf</code> as the hash function,
  492. <code>a</code> as the allocator, with the
  493. default key equality predicate
  494. and a maximum load factor of 1.0
  495. and inserts the elements from [f, l) into it.
  496. </para>
  497. </description>
  498. <requires>
  499. <para><code>key_equal</code> needs to be <code>DefaultConstructible</code>.
  500. </para>
  501. </requires>
  502. </constructor>
  503. <destructor>
  504. <notes>
  505. <para>The destructor is applied to every element, and all memory is deallocated</para>
  506. </notes>
  507. </destructor>
  508. <method name="operator=">
  509. <parameter>
  510. <paramtype><?php echo $name; ?> const&amp;</paramtype>
  511. </parameter>
  512. <type><?php echo $name; ?>&amp;</type>
  513. <description>
  514. <para>The assignment operator. Copies the contained elements, hash function, predicate and maximum load factor but not the allocator.</para>
  515. <para>If <code>Alloc::propagate_on_container_copy_assignment</code>
  516. exists and <code>Alloc::propagate_on_container_copy_assignment::value
  517. </code> is true, the allocator is overwritten, if not the
  518. copied elements are created using the existing
  519. allocator.</para>
  520. </description>
  521. <requires>
  522. <para><code>value_type</code> is copy constructible</para>
  523. </requires>
  524. </method>
  525. <method name="operator=">
  526. <parameter>
  527. <paramtype><?php echo $name; ?> &amp;&amp;</paramtype>
  528. </parameter>
  529. <type><?php echo $name; ?>&amp;</type>
  530. <description>
  531. <para>The move assignment operator.</para>
  532. <para>If <code>Alloc::propagate_on_container_move_assignment</code>
  533. exists and <code>Alloc::propagate_on_container_move_assignment::value
  534. </code> is true, the allocator is overwritten, if not the
  535. moved elements are created using the existing
  536. allocator.</para>
  537. </description>
  538. <notes>
  539. <para>
  540. On compilers without rvalue references, this is emulated using
  541. Boost.Move. Note that on some compilers the copy assignment
  542. operator may be used in some circumstances.
  543. </para>
  544. </notes>
  545. <requires>
  546. <para>
  547. <code>value_type</code> is move constructible.
  548. </para>
  549. </requires>
  550. </method>
  551. <method name="operator=">
  552. <parameter>
  553. <paramtype>initializer_list&lt;value_type&gt;</paramtype>
  554. </parameter>
  555. <type><?php echo $name; ?>&amp;</type>
  556. <description>
  557. <para>Assign from values in initializer list. All existing elements are either overwritten by the new elements or destroyed.</para>
  558. </description>
  559. <requires>
  560. <para>
  561. <code>value_type</code> is <code>CopyInsertable</code> into the container and
  562. <code>CopyAssignable</code>.
  563. </para>
  564. </requires>
  565. </method>
  566. <method name="get_allocator" cv="const">
  567. <type>allocator_type</type>
  568. </method>
  569. <method-group name="size and capacity">
  570. <method name="empty" cv="const">
  571. <type>bool</type>
  572. <returns>
  573. <code><methodname>size</methodname>() == 0</code>
  574. </returns>
  575. </method>
  576. <method name="size" cv="const">
  577. <type>size_type</type>
  578. <returns>
  579. <code>std::distance(<methodname>begin</methodname>(), <methodname>end</methodname>())</code>
  580. </returns>
  581. </method>
  582. <method name="max_size" cv="const">
  583. <type>size_type</type>
  584. <returns><code><methodname>size</methodname>()</code> of the largest possible container.
  585. </returns>
  586. </method>
  587. </method-group>
  588. <method-group name="iterators">
  589. <overloaded-method name="begin">
  590. <signature><type>iterator</type></signature>
  591. <signature cv="const"><type>const_iterator</type></signature>
  592. <returns>An iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container.
  593. </returns>
  594. </overloaded-method>
  595. <overloaded-method name="end">
  596. <signature>
  597. <type>iterator</type>
  598. </signature>
  599. <signature cv="const">
  600. <type>const_iterator</type>
  601. </signature>
  602. <returns>An iterator which refers to the past-the-end value for the container.
  603. </returns>
  604. </overloaded-method>
  605. <method name="cbegin" cv="const">
  606. <type>const_iterator</type>
  607. <returns>A constant iterator referring to the first element of the container, or if the container is empty the past-the-end value for the container.
  608. </returns>
  609. </method>
  610. <method name="cend" cv="const">
  611. <type>const_iterator</type>
  612. <returns>A constant iterator which refers to the past-the-end value for the container.
  613. </returns>
  614. </method>
  615. </method-group>
  616. <method-group name="modifiers">
  617. <method name="emplace">
  618. <template>
  619. <template-type-parameter name="Args" pack="1">
  620. </template-type-parameter>
  621. </template>
  622. <parameter name="args" pack="1">
  623. <paramtype>Args&amp;&amp;</paramtype>
  624. </parameter>
  625. <type><?php echo $equivalent_keys ? 'iterator' : 'std::pair&lt;iterator, bool&gt;' ?></type>
  626. <description>
  627. <para>Inserts an object, constructed with the arguments <code>args</code>, in the container<?php
  628. echo $equivalent_keys ? '.' :
  629. ' if and only if there is no element in the container with an equivalent '.$key_name. '.';
  630. ?></para>
  631. </description>
  632. <requires>
  633. <para><code>value_type</code> is <code>EmplaceConstructible</code> into
  634. <code>X</code> from <code>args</code>.
  635. </para>
  636. </requires>
  637. <returns>
  638. <?php if ($equivalent_keys): ?>
  639. <para>An iterator pointing to the inserted element.</para>
  640. <?php else: ?>
  641. <para>The bool component of the return type is true if an insert took place.</para>
  642. <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>
  643. <?php endif; ?>
  644. </returns>
  645. <throws>
  646. <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  647. </throws>
  648. <notes>
  649. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  650. <para>Pointers and references to elements are never invalidated.</para>
  651. <para>If the compiler doesn't support variadic template arguments or rvalue
  652. references, this is emulated for up to 10 arguments, with no support
  653. for rvalue references or move semantics.</para>
  654. <para>Since existing <code>std::pair</code> implementations don't support
  655. <code>std::piecewise_construct</code> this emulates it,
  656. but using <code>boost::unordered::piecewise_construct</code>.</para>
  657. </notes>
  658. </method>
  659. <method name="emplace_hint">
  660. <template>
  661. <template-type-parameter name="Args" pack="1">
  662. </template-type-parameter>
  663. </template>
  664. <parameter name="hint">
  665. <paramtype>const_iterator</paramtype>
  666. </parameter>
  667. <parameter name="args" pack="1">
  668. <paramtype>Args&amp;&amp;</paramtype>
  669. </parameter>
  670. <type>iterator</type>
  671. <description>
  672. <para>Inserts an object, constructed with the arguments <code>args</code>, in the container<?php
  673. echo $equivalent_keys ? '.' :
  674. ' if and only if there is no element in the container with an equivalent '.$key_name. '.';
  675. ?></para>
  676. <para><code>hint</code> is a suggestion to where the element should be inserted.</para>
  677. </description>
  678. <requires>
  679. <para><code>value_type</code> is <code>EmplaceConstructible</code> into
  680. <code>X</code> from <code>args</code>.
  681. </para>
  682. </requires>
  683. <returns>
  684. <?php if ($equivalent_keys): ?>
  685. <para>An iterator pointing to the inserted element.</para>
  686. <?php else: ?>
  687. <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>
  688. <?php endif; ?>
  689. </returns>
  690. <throws>
  691. <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  692. </throws>
  693. <notes>
  694. <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same <?php echo $key_name; ?>. </para>
  695. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  696. <para>Pointers and references to elements are never invalidated.</para>
  697. <para>If the compiler doesn't support variadic template arguments or rvalue
  698. references, this is emulated for up to 10 arguments, with no support
  699. for rvalue references or move semantics.</para>
  700. <para>Since existing <code>std::pair</code> implementations don't support
  701. <code>std::piecewise_construct</code> this emulates it,
  702. but using <code>boost::unordered::piecewise_construct</code>.</para>
  703. </notes>
  704. </method>
  705. <method name="insert">
  706. <parameter name="obj">
  707. <paramtype>value_type const&amp;</paramtype>
  708. </parameter>
  709. <type><?php echo $equivalent_keys ? 'iterator' : 'std::pair&lt;iterator, bool&gt;' ?></type>
  710. <description>
  711. <para>Inserts <code>obj</code> in the container<?php
  712. echo $equivalent_keys ? '.' :
  713. ' if and only if there is no element in the container with an equivalent '.$key_name. '.';
  714. ?></para>
  715. </description>
  716. <requires>
  717. <para><code>value_type</code> is <code>CopyInsertable</code>.</para>
  718. </requires>
  719. <returns>
  720. <?php if ($equivalent_keys): ?>
  721. <para>An iterator pointing to the inserted element.</para>
  722. <?php else: ?>
  723. <para>The bool component of the return type is true if an insert took place.</para>
  724. <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>
  725. <?php endif; ?>
  726. </returns>
  727. <throws>
  728. <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  729. </throws>
  730. <notes>
  731. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  732. <para>Pointers and references to elements are never invalidated.</para>
  733. </notes>
  734. </method>
  735. <method name="insert">
  736. <parameter name="obj">
  737. <paramtype>value_type&amp;&amp;</paramtype>
  738. </parameter>
  739. <type><?php echo $equivalent_keys ? 'iterator' : 'std::pair&lt;iterator, bool&gt;' ?></type>
  740. <description>
  741. <para>Inserts <code>obj</code> in the container<?php
  742. echo $equivalent_keys ? '.' :
  743. ' if and only if there is no element in the container with an equivalent '.$key_name. '.';
  744. ?></para>
  745. </description>
  746. <requires>
  747. <para><code>value_type</code> is <code>MoveInsertable</code>.</para>
  748. </requires>
  749. <returns>
  750. <?php if ($equivalent_keys): ?>
  751. <para>An iterator pointing to the inserted element.</para>
  752. <?php else: ?>
  753. <para>The bool component of the return type is true if an insert took place.</para>
  754. <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>
  755. <?php endif; ?>
  756. </returns>
  757. <throws>
  758. <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  759. </throws>
  760. <notes>
  761. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  762. <para>Pointers and references to elements are never invalidated.</para>
  763. </notes>
  764. </method>
  765. <method name="insert">
  766. <parameter name="hint">
  767. <paramtype>const_iterator</paramtype>
  768. </parameter>
  769. <parameter name="obj">
  770. <paramtype>value_type const&amp;</paramtype>
  771. </parameter>
  772. <type>iterator</type>
  773. <description>
  774. <?php if ($equivalent_keys): ?>
  775. <para>Inserts <code>obj</code> in the container.</para>
  776. <?php else: ?>
  777. <para>Inserts <code>obj</code> in the container if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.</para>
  778. <?php endif; ?>
  779. <para>hint is a suggestion to where the element should be inserted.</para>
  780. </description>
  781. <requires>
  782. <para><code>value_type</code> is <code>CopyInsertable</code>.</para>
  783. </requires>
  784. <returns>
  785. <?php if ($equivalent_keys): ?>
  786. <para>An iterator pointing to the inserted element.</para>
  787. <?php else: ?>
  788. <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>
  789. <?php endif; ?>
  790. </returns>
  791. <throws>
  792. <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  793. </throws>
  794. <notes>
  795. <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same <?php echo $key_name; ?>. </para>
  796. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  797. <para>Pointers and references to elements are never invalidated.</para>
  798. </notes>
  799. </method>
  800. <method name="insert">
  801. <parameter name="hint">
  802. <paramtype>const_iterator</paramtype>
  803. </parameter>
  804. <parameter name="obj">
  805. <paramtype>value_type&amp;&amp;</paramtype>
  806. </parameter>
  807. <type>iterator</type>
  808. <description>
  809. <?php if ($equivalent_keys): ?>
  810. <para>Inserts <code>obj</code> in the container.</para>
  811. <?php else: ?>
  812. <para>Inserts <code>obj</code> in the container if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.</para>
  813. <?php endif; ?>
  814. <para>hint is a suggestion to where the element should be inserted.</para>
  815. </description>
  816. <requires>
  817. <para><code>value_type</code> is <code>MoveInsertable</code>.</para>
  818. </requires>
  819. <returns>
  820. <?php if ($equivalent_keys): ?>
  821. <para>An iterator pointing to the inserted element.</para>
  822. <?php else: ?>
  823. <para>If an insert took place, then the iterator points to the newly inserted element. Otherwise, it points to the element with equivalent <?php echo $key_name; ?>.</para>
  824. <?php endif; ?>
  825. </returns>
  826. <throws>
  827. <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  828. </throws>
  829. <notes>
  830. <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same <?php echo $key_name; ?>. </para>
  831. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  832. <para>Pointers and references to elements are never invalidated.</para>
  833. </notes>
  834. </method>
  835. <method name="insert">
  836. <template>
  837. <template-type-parameter name="InputIterator">
  838. </template-type-parameter>
  839. </template>
  840. <parameter name="first">
  841. <paramtype>InputIterator</paramtype>
  842. </parameter>
  843. <parameter name="last">
  844. <paramtype>InputIterator</paramtype>
  845. </parameter>
  846. <type>void</type>
  847. <description>
  848. <para>Inserts a range of elements into the container.
  849. <?php if (!$equivalent_keys): ?>
  850. Elements are inserted if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.
  851. <?php endif; ?>
  852. </para>
  853. </description>
  854. <requires>
  855. <para><code>value_type</code> is <code>EmplaceConstructible</code> into
  856. <code>X</code> from <code>*first</code>.</para>
  857. </requires>
  858. <throws>
  859. <para>When inserting a single element, if an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  860. </throws>
  861. <notes>
  862. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  863. <para>Pointers and references to elements are never invalidated.</para>
  864. </notes>
  865. </method>
  866. <method name="insert">
  867. <parameter name="il">
  868. <paramtype>initializer_list&lt;value_type&gt;</paramtype>
  869. </parameter>
  870. <type>void</type>
  871. <description>
  872. <para>Inserts a range of elements into the container.
  873. <?php if (!$equivalent_keys): ?>
  874. Elements are inserted if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.
  875. <?php endif; ?>
  876. </para>
  877. </description>
  878. <requires>
  879. <para><code>value_type</code> is <code>EmplaceConstructible</code> into
  880. <code>X</code> from <code>*first</code>.</para>
  881. </requires>
  882. <throws>
  883. <para>When inserting a single element, if an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  884. </throws>
  885. <notes>
  886. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  887. <para>Pointers and references to elements are never invalidated.</para>
  888. </notes>
  889. </method>
  890. <method name="insert">
  891. <parameter name="il">
  892. <paramtype>initializer_list&lt;value_type&gt;</paramtype>
  893. </parameter>
  894. <type>void</type>
  895. <description>
  896. <para>Inserts a range of elements into the container. Elements are inserted if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.</para>
  897. </description>
  898. <requires>
  899. <para><code>value_type</code> is <code>EmplaceConstructible</code> into
  900. <code>X</code> from <code>*first</code>.</para>
  901. </requires>
  902. <throws>
  903. <para>When inserting a single element, if an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  904. </throws>
  905. <notes>
  906. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  907. <para>Pointers and references to elements are never invalidated.</para>
  908. </notes>
  909. </method>
  910. <method name="extract">
  911. <parameter name="position">
  912. <paramtype>const_iterator</paramtype>
  913. </parameter>
  914. <type>node_type</type>
  915. <description>
  916. <para>Removes the element pointed to by <code>position</code>.</para>
  917. </description>
  918. <returns>
  919. <para>A <code>node_type</code> owning the element.</para>
  920. </returns>
  921. <notes>
  922. <para>
  923. In C++17 a node extracted using this method can be inserted into a compatible <code><?php echo $node_partner; ?></code>,
  924. but that is not supported yet.
  925. </para>
  926. </notes>
  927. </method>
  928. <method name="extract">
  929. <parameter name="k">
  930. <paramtype>key_type const&amp;</paramtype>
  931. </parameter>
  932. <type>node_type</type>
  933. <description>
  934. <para>Removes an element with key equivalent to <code>k</code>.</para>
  935. </description>
  936. <returns>
  937. <para>A <code>node_type</code> owning the element if found, otherwise an empty <code>node_type</code>.</para>
  938. </returns>
  939. <throws>
  940. <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>
  941. </throws>
  942. <notes>
  943. <para>
  944. In C++17 a node extracted using this method can be inserted into a compatible <code><?php echo $node_partner; ?></code>,
  945. but that is not supported yet.
  946. </para>
  947. </notes>
  948. </method>
  949. <method name="insert">
  950. <parameter name="nh">
  951. <paramtype>node_type&amp;&amp;</paramtype>
  952. </parameter>
  953. <type><?php echo $equivalent_keys ? 'iterator' : 'insert_return_type' ?></type>
  954. <description>
  955. <para>If <code>nh</code> is empty, has no affect.</para>
  956. <?php if ($equivalent_keys): ?>
  957. <para>Otherwise inserts the element owned by <code>nh</code></para>
  958. <?php else: ?>
  959. <para>Otherwise inserts the element owned by <code>nh</code>
  960. if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.
  961. </para>
  962. <?php endif ?>
  963. </description>
  964. <requires>
  965. <para><code>nh</code> is empty or <code>nh.get_allocator()</code> is equal to the container's allocator.</para>
  966. </requires>
  967. <returns>
  968. <?php if ($equivalent_keys): ?>
  969. <para>If <code>nh</code> was empty, returns <code>end()</code>.</para>
  970. <para>Otherwise returns an iterator pointing to the newly inserted element.</para>
  971. <?php else: ?>
  972. <para>If <code>nh</code> was empty, returns an <code>insert_return_type</code> with:
  973. <code>inserted</code> equal to <code>false</code>,
  974. <code>position</code> equal to <code>end()</code> and
  975. <code>node</code> empty.</para>
  976. <para>Otherwise if there was already an element with an equivalent key, returns an <code>insert_return_type</code> with:
  977. <code>inserted</code> equal to <code>false</code>,
  978. <code>position</code> pointing to a matching element and
  979. <code>node</code> contains the node from <code>nh</code>.</para>
  980. <para>Otherwise if the insertion succeeded, returns an <code>insert_return_type</code> with:
  981. <code>inserted</code> equal to <code>true</code>,
  982. <code>position</code> pointing to the newly inserted element and
  983. <code>node</code> empty.</para>
  984. <?php endif; ?>
  985. </returns>
  986. <throws>
  987. <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  988. </throws>
  989. <notes>
  990. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  991. <para>Pointers and references to elements are never invalidated.</para>
  992. <para>In C++17 this can be used to insert a node extracted from a compatible <code><?php echo $node_partner; ?></code>,
  993. but that is not supported yet.</para>
  994. </notes>
  995. </method>
  996. <method name="insert">
  997. <parameter name="hint">
  998. <paramtype>const_iterator</paramtype>
  999. </parameter>
  1000. <parameter name="nh">
  1001. <paramtype>node_type&amp;&amp;</paramtype>
  1002. </parameter>
  1003. <type>iterator</type>
  1004. <description>
  1005. <para>If <code>nh</code> is empty, has no affect.</para>
  1006. <?php if ($equivalent_keys): ?>
  1007. <para>Otherwise inserts the element owned by <code>nh</code></para>
  1008. <?php else: ?>
  1009. <para>Otherwise inserts the element owned by <code>nh</code>
  1010. if and only if there is no element in the container with an equivalent <?php echo $key_name; ?>.
  1011. </para>
  1012. <para>If there is already an element in the container with an equivalent <?php echo $key_name; ?>
  1013. has no effect on <code>nh</code> (i.e. <code>nh</code> still contains the node.)</para>
  1014. <?php endif ?>
  1015. <para>hint is a suggestion to where the element should be inserted.</para>
  1016. </description>
  1017. <requires>
  1018. <para><code>nh</code> is empty or <code>nh.get_allocator()</code> is equal to the container's allocator.</para>
  1019. </requires>
  1020. <returns>
  1021. <?php if ($equivalent_keys): ?>
  1022. <para>If <code>nh</code> was empty, returns <code>end()</code>.</para>
  1023. <para>Otherwise returns an iterator pointing to the newly inserted element.</para>
  1024. <?php else: ?>
  1025. <para>If <code>nh</code> was empty returns <code>end()</code>.</para>
  1026. <para>If there was already an element in the container with an equivalent <?php echo $key_name; ?>
  1027. returns an iterator pointing to that.</para>
  1028. <para>Otherwise returns an iterator pointing to the newly inserted element.</para>
  1029. <?php endif; ?>
  1030. </returns>
  1031. <throws>
  1032. <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  1033. </throws>
  1034. <notes>
  1035. <para>The standard is fairly vague on the meaning of the hint. But the only practical way to use it, and the only way that Boost.Unordered supports is to point to an existing element with the same <?php echo $key_name; ?>. </para>
  1036. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  1037. <para>Pointers and references to elements are never invalidated.</para>
  1038. <para>In C++17 this can be used to insert a node extracted from a compatible <code><?php echo $node_partner; ?></code>,
  1039. but that is not supported yet.</para>
  1040. </notes>
  1041. </method>
  1042. <method name="erase">
  1043. <parameter name="position">
  1044. <paramtype>const_iterator</paramtype>
  1045. </parameter>
  1046. <type>iterator</type>
  1047. <description>
  1048. <para>Erase the element pointed to by <code>position</code>.</para>
  1049. </description>
  1050. <returns>
  1051. <para>The iterator following <code>position</code> before the erasure.</para>
  1052. </returns>
  1053. <throws>
  1054. <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>
  1055. </throws>
  1056. <notes>
  1057. <para>
  1058. In older versions this could be inefficient because it had to search
  1059. through several buckets to find the position of the returned iterator.
  1060. The data structure has been changed so that this is no longer the case,
  1061. and the alternative erase methods have been deprecated.
  1062. </para>
  1063. </notes>
  1064. </method>
  1065. <method name="erase">
  1066. <parameter name="k">
  1067. <paramtype>key_type const&amp;</paramtype>
  1068. </parameter>
  1069. <type>size_type</type>
  1070. <description>
  1071. <para>Erase all elements with key equivalent to <code>k</code>.</para>
  1072. </description>
  1073. <returns>
  1074. <para>The number of elements erased.</para>
  1075. </returns>
  1076. <throws>
  1077. <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>
  1078. </throws>
  1079. </method>
  1080. <method name="erase">
  1081. <parameter name="first">
  1082. <paramtype>const_iterator</paramtype>
  1083. </parameter>
  1084. <parameter name="last">
  1085. <paramtype>const_iterator</paramtype>
  1086. </parameter>
  1087. <type>iterator</type>
  1088. <description>
  1089. <para>Erases the elements in the range from <code>first</code> to <code>last</code>.</para>
  1090. </description>
  1091. <returns>
  1092. <para>The iterator following the erased elements - i.e. <code>last</code>.</para>
  1093. </returns>
  1094. <throws>
  1095. <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>
  1096. <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para>
  1097. </throws>
  1098. </method>
  1099. <method name="quick_erase">
  1100. <parameter name="position">
  1101. <paramtype>const_iterator</paramtype>
  1102. </parameter>
  1103. <type>void</type>
  1104. <description>
  1105. <para>Erase the element pointed to by <code>position</code>.</para>
  1106. </description>
  1107. <throws>
  1108. <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>
  1109. <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para>
  1110. </throws>
  1111. <notes>
  1112. <para>
  1113. This method was implemented because returning an iterator to
  1114. the next element from <code>erase</code> was expensive, but
  1115. the container has been redesigned so that is no longer the
  1116. case. So this method is now deprecated.
  1117. </para>
  1118. </notes>
  1119. </method>
  1120. <method name="erase_return_void">
  1121. <parameter name="position">
  1122. <paramtype>const_iterator</paramtype>
  1123. </parameter>
  1124. <type>void</type>
  1125. <description>
  1126. <para>Erase the element pointed to by <code>position</code>.</para>
  1127. </description>
  1128. <throws>
  1129. <para>Only throws an exception if it is thrown by <code>hasher</code> or <code>key_equal</code>.</para>
  1130. <para>In this implementation, this overload doesn't call either function object's methods so it is no throw, but this might not be true in other implementations.</para>
  1131. </throws>
  1132. <notes>
  1133. <para>
  1134. This method was implemented because returning an iterator to
  1135. the next element from <code>erase</code> was expensive, but
  1136. the container has been redesigned so that is no longer the
  1137. case. So this method is now deprecated.
  1138. </para>
  1139. </notes>
  1140. </method>
  1141. <method name="clear">
  1142. <type>void</type>
  1143. <description>
  1144. <para>Erases all elements in the container.</para>
  1145. </description>
  1146. <postconditions>
  1147. <para><code><methodname>size</methodname>() == 0</code></para>
  1148. </postconditions>
  1149. <throws>
  1150. <para>Never throws an exception.</para>
  1151. </throws>
  1152. </method>
  1153. <method name="swap">
  1154. <parameter>
  1155. <paramtype><?php echo $name; ?>&amp;</paramtype>
  1156. </parameter>
  1157. <type>void</type>
  1158. <description>
  1159. <para>Swaps the contents of the container with the parameter.</para>
  1160. <para>If <code>Allocator::propagate_on_container_swap</code> is declared and
  1161. <code>Allocator::propagate_on_container_swap::value</code> is true then the
  1162. containers' allocators are swapped. Otherwise, swapping with unequal allocators
  1163. results in undefined behavior.</para>
  1164. </description>
  1165. <throws>
  1166. <para>Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of <code>key_equal</code> or <code>hasher</code>.</para>
  1167. </throws>
  1168. <notes>
  1169. <para>The exception specifications aren't quite the same as the C++11 standard, as
  1170. the equality predieate and hash function are swapped using their copy constructors.</para>
  1171. </notes>
  1172. </method>
  1173. <method name="merge">
  1174. <template>
  1175. <template-type-parameter name="H2">
  1176. </template-type-parameter>
  1177. <template-type-parameter name="P2">
  1178. </template-type-parameter>
  1179. </template>
  1180. <parameter name="source">
  1181. <?php if ($map): ?>
  1182. <paramtype><?php echo $name; ?>&lt;Key, Mapped, H2, P2, Alloc&gt;&amp;</paramtype>
  1183. <?php else: ?>
  1184. <paramtype><?php echo $name; ?>&lt;Value, H2, P2, Alloc&gt;&amp;</paramtype>
  1185. <?php endif; ?>
  1186. </parameter>
  1187. <notes>
  1188. <para>Does not support merging with a compatible <code><?php echo $node_partner; ?></code> yet.</para>
  1189. </notes>
  1190. </method>
  1191. <method name="merge">
  1192. <template>
  1193. <template-type-parameter name="H2">
  1194. </template-type-parameter>
  1195. <template-type-parameter name="P2">
  1196. </template-type-parameter>
  1197. </template>
  1198. <parameter name="source">
  1199. <?php if ($map): ?>
  1200. <paramtype><?php echo $name; ?>&lt;Key, Mapped, H2, P2, Alloc&gt;&amp;&amp;</paramtype>
  1201. <?php else: ?>
  1202. <paramtype><?php echo $name; ?>&lt;Value, H2, P2, Alloc&gt;&amp;&amp;</paramtype>
  1203. <?php endif; ?>
  1204. </parameter>
  1205. <notes>
  1206. <para>Does not support merging with a compatible <code><?php echo $node_partner; ?></code> yet.</para>
  1207. </notes>
  1208. </method>
  1209. <?php /*
  1210. <method name="merge">
  1211. <template>
  1212. <template-type-parameter name="H2">
  1213. </template-type-parameter>
  1214. <template-type-parameter name="P2">
  1215. </template-type-parameter>
  1216. </template>
  1217. <parameter name="source">
  1218. <?php if ($map): ?>
  1219. <paramtype><?php echo $node_partner; ?>&lt;Key, Mapped, H2, P2, Alloc&gt;&amp;</paramtype>
  1220. <?php else: ?>
  1221. <paramtype><?php echo $node_partner; ?>&lt;Value, H2, P2, Alloc&gt;&amp;</paramtype>
  1222. <?php endif; ?>
  1223. </parameter>
  1224. </method>
  1225. <method name="merge">
  1226. <template>
  1227. <template-type-parameter name="H2">
  1228. </template-type-parameter>
  1229. <template-type-parameter name="P2">
  1230. </template-type-parameter>
  1231. </template>
  1232. <parameter name="source">
  1233. <?php if ($map): ?>
  1234. <paramtype><?php echo $node_partner; ?>&lt;Key, Mapped, H2, P2, Alloc&gt;&amp;&amp;</paramtype>
  1235. <?php else: ?>
  1236. <paramtype><?php echo $node_partner; ?>&lt;Value, H2, P2, Alloc&gt;&amp;&amp;</paramtype>
  1237. <?php endif; ?>
  1238. </parameter>
  1239. </method>
  1240. */ ?>
  1241. </method-group>
  1242. <method-group name="observers">
  1243. <method name="hash_function" cv="const">
  1244. <type>hasher</type>
  1245. <returns>The container's hash function.
  1246. </returns>
  1247. </method>
  1248. <method name="key_eq" cv="const">
  1249. <type>key_equal</type>
  1250. <returns>The container's key equality predicate.
  1251. </returns>
  1252. </method>
  1253. </method-group>
  1254. <method-group name="lookup">
  1255. <overloaded-method name="find">
  1256. <signature>
  1257. <parameter name="k">
  1258. <paramtype>key_type const&amp;</paramtype>
  1259. </parameter>
  1260. <type>iterator</type>
  1261. </signature>
  1262. <signature cv="const">
  1263. <parameter name="k">
  1264. <paramtype>key_type const&amp;</paramtype>
  1265. </parameter>
  1266. <type>const_iterator</type>
  1267. </signature>
  1268. <signature>
  1269. <template>
  1270. <template-type-parameter name="CompatibleKey"/>
  1271. <template-type-parameter name="CompatibleHash"/>
  1272. <template-type-parameter name="CompatiblePredicate"/>
  1273. </template>
  1274. <parameter name="k">
  1275. <paramtype>CompatibleKey const&amp;</paramtype>
  1276. </parameter>
  1277. <parameter name="hash">
  1278. <paramtype>CompatibleHash const&amp;</paramtype>
  1279. </parameter>
  1280. <parameter name="eq">
  1281. <paramtype>CompatiblePredicate const&amp;</paramtype>
  1282. </parameter>
  1283. <type>iterator</type>
  1284. </signature>
  1285. <signature cv="const">
  1286. <template>
  1287. <template-type-parameter name="CompatibleKey"/>
  1288. <template-type-parameter name="CompatibleHash"/>
  1289. <template-type-parameter name="CompatiblePredicate"/>
  1290. </template>
  1291. <parameter name="k">
  1292. <paramtype>CompatibleKey const&amp;</paramtype>
  1293. </parameter>
  1294. <parameter name="hash">
  1295. <paramtype>CompatibleHash const&amp;</paramtype>
  1296. </parameter>
  1297. <parameter name="eq">
  1298. <paramtype>CompatiblePredicate const&amp;</paramtype>
  1299. </parameter>
  1300. <type>const_iterator</type>
  1301. </signature>
  1302. <returns>
  1303. <para>An iterator pointing to an element with key equivalent to <code>k</code>, or <code>b.end()</code> if no such element exists.</para>
  1304. </returns>
  1305. <notes><para>
  1306. The templated overloads are a non-standard extensions which
  1307. allows you to use a compatible hash function and equality
  1308. predicate for a key of a different type in order to avoid
  1309. an expensive type cast. In general, its use is not encouraged.
  1310. </para></notes>
  1311. </overloaded-method>
  1312. <method name="count" cv="const">
  1313. <parameter name="k">
  1314. <paramtype>key_type const&amp;</paramtype>
  1315. </parameter>
  1316. <type>size_type</type>
  1317. <returns>
  1318. <para>The number of elements with key equivalent to <code>k</code>.</para>
  1319. </returns>
  1320. </method>
  1321. <overloaded-method name="equal_range">
  1322. <signature>
  1323. <parameter name="k">
  1324. <paramtype>key_type const&amp;</paramtype>
  1325. </parameter>
  1326. <type>std::pair&lt;iterator, iterator&gt;</type>
  1327. </signature>
  1328. <signature cv="const">
  1329. <parameter name="k">
  1330. <paramtype>key_type const&amp;</paramtype>
  1331. </parameter>
  1332. <type>std::pair&lt;const_iterator, const_iterator&gt;</type>
  1333. </signature>
  1334. <returns>
  1335. <para>A range containing all elements with key equivalent to <code>k</code>.
  1336. If the container doesn't container any such elements, returns
  1337. <code><functionname>std::make_pair</functionname>(<methodname>b.end</methodname>(),<methodname>b.end</methodname>())</code>.
  1338. </para>
  1339. </returns>
  1340. </overloaded-method>
  1341. <?php if ($map && !$equivalent_keys): ?>
  1342. <method name="operator[]">
  1343. <parameter name="k">
  1344. <paramtype>key_type const&amp;</paramtype>
  1345. </parameter>
  1346. <type>mapped_type&amp;</type>
  1347. <effects>
  1348. <para>If the container does not already contain an elements with a key equivalent to <code>k</code>, inserts the value <code>std::pair&lt;key_type const, mapped_type&gt;(k, mapped_type())</code></para>
  1349. </effects>
  1350. <returns>
  1351. <para>A reference to <code>x.second</code> where x is the element already in the container, or the newly inserted element with a key equivalent to <code>k</code></para>
  1352. </returns>
  1353. <throws>
  1354. <para>If an exception is thrown by an operation other than a call to <code>hasher</code> the function has no effect.</para>
  1355. </throws>
  1356. <notes>
  1357. <para>Can invalidate iterators, but only if the insert causes the load factor to be greater to or equal to the maximum load factor.</para>
  1358. <para>Pointers and references to elements are never invalidated.</para>
  1359. </notes>
  1360. </method>
  1361. <overloaded-method name="at">
  1362. <signature><type>Mapped&amp;</type>
  1363. <parameter name="k"><paramtype>key_type const&amp;</paramtype></parameter></signature>
  1364. <signature cv="const"><type>Mapped const&amp;</type>
  1365. <parameter name="k"><paramtype>key_type const&amp;</paramtype></parameter></signature>
  1366. <returns>
  1367. <para>A reference to <code>x.second</code> where <code>x</code> is the (unique) element whose key is equivalent to <code>k</code>.</para>
  1368. </returns>
  1369. <throws>
  1370. <para>An exception object of type <code>std::out_of_range</code> if no such element is present.</para>
  1371. </throws>
  1372. </overloaded-method>
  1373. <?php endif; ?>
  1374. </method-group>
  1375. <method-group name="bucket interface">
  1376. <method name="bucket_count" cv="const">
  1377. <type>size_type</type>
  1378. <returns>
  1379. <para>The number of buckets.</para>
  1380. </returns>
  1381. </method>
  1382. <method name="max_bucket_count" cv="const">
  1383. <type>size_type</type>
  1384. <returns>
  1385. <para>An upper bound on the number of buckets.</para>
  1386. </returns>
  1387. </method>
  1388. <method name="bucket_size" cv="const">
  1389. <parameter name="n">
  1390. <paramtype>size_type</paramtype>
  1391. </parameter>
  1392. <type>size_type</type>
  1393. <requires>
  1394. <para><code>n &lt; <methodname>bucket_count</methodname>()</code></para>
  1395. </requires>
  1396. <returns>
  1397. <para>The number of elements in bucket <code>n</code>.</para>
  1398. </returns>
  1399. </method>
  1400. <method name="bucket" cv="const">
  1401. <parameter name="k">
  1402. <paramtype>key_type const&amp;</paramtype>
  1403. </parameter>
  1404. <type>size_type</type>
  1405. <returns>
  1406. <para>The index of the bucket which would contain an element with key <code>k</code>.</para>
  1407. </returns>
  1408. <postconditions>
  1409. <para>The return value is less than <code>bucket_count()</code></para>
  1410. </postconditions>
  1411. </method>
  1412. <overloaded-method name="begin">
  1413. <signature>
  1414. <parameter name="n">
  1415. <paramtype>size_type</paramtype>
  1416. </parameter>
  1417. <type>local_iterator</type>
  1418. </signature>
  1419. <signature cv="const">
  1420. <parameter name="n">
  1421. <paramtype>size_type</paramtype>
  1422. </parameter>
  1423. <type>const_local_iterator</type>
  1424. </signature>
  1425. <requires>
  1426. <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para>
  1427. </requires>
  1428. <returns>
  1429. <para>A local iterator pointing the first element in the bucket with index <code>n</code>.</para>
  1430. </returns>
  1431. </overloaded-method>
  1432. <overloaded-method name="end">
  1433. <signature>
  1434. <parameter name="n">
  1435. <paramtype>size_type</paramtype>
  1436. </parameter>
  1437. <type>local_iterator</type>
  1438. </signature>
  1439. <signature cv="const">
  1440. <parameter name="n">
  1441. <paramtype>size_type</paramtype>
  1442. </parameter>
  1443. <type>const_local_iterator</type>
  1444. </signature>
  1445. <requires>
  1446. <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para>
  1447. </requires>
  1448. <returns>
  1449. <para>A local iterator pointing the 'one past the end' element in the bucket with index <code>n</code>.</para>
  1450. </returns>
  1451. </overloaded-method>
  1452. <method name="cbegin" cv="const">
  1453. <parameter name="n">
  1454. <paramtype>size_type</paramtype>
  1455. </parameter>
  1456. <type>const_local_iterator</type>
  1457. <requires>
  1458. <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para>
  1459. </requires>
  1460. <returns>
  1461. <para>A constant local iterator pointing the first element in the bucket with index <code>n</code>.</para>
  1462. </returns>
  1463. </method>
  1464. <method name="cend">
  1465. <parameter name="n">
  1466. <paramtype>size_type</paramtype>
  1467. </parameter>
  1468. <type>const_local_iterator</type>
  1469. <requires>
  1470. <para><code>n</code> shall be in the range <code>[0, bucket_count())</code>.</para>
  1471. </requires>
  1472. <returns>
  1473. <para>A constant local iterator pointing the 'one past the end' element in the bucket with index <code>n</code>.</para>
  1474. </returns>
  1475. </method>
  1476. </method-group>
  1477. <method-group name="hash policy">
  1478. <method name="load_factor" cv="const">
  1479. <type>float</type>
  1480. <returns>
  1481. <para>The average number of elements per bucket.</para>
  1482. </returns>
  1483. </method>
  1484. <method name="max_load_factor" cv="const">
  1485. <type>float</type>
  1486. <returns>
  1487. <para>Returns the current maximum load factor.</para>
  1488. </returns>
  1489. </method>
  1490. <method name="max_load_factor">
  1491. <parameter name="z">
  1492. <paramtype>float</paramtype>
  1493. </parameter>
  1494. <type>void</type>
  1495. <effects>
  1496. <para>Changes the container's maximum load factor, using <code>z</code> as a hint.</para>
  1497. </effects>
  1498. </method>
  1499. <method name="rehash">
  1500. <parameter name="n">
  1501. <paramtype>size_type</paramtype>
  1502. </parameter>
  1503. <type>void</type>
  1504. <description>
  1505. <para>Changes the number of buckets so that there at least <code>n</code> buckets, and so that the load factor is less than the maximum load factor.</para>
  1506. <para>Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.</para>
  1507. </description>
  1508. <throws>
  1509. <para>The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.</para>
  1510. </throws>
  1511. </method>
  1512. <method name="reserve">
  1513. <parameter name="n">
  1514. <paramtype>size_type</paramtype>
  1515. </parameter>
  1516. <type>void</type>
  1517. <description>
  1518. <para>Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.</para>
  1519. </description>
  1520. <throws>
  1521. <para>The function has no effect if an exception is thrown, unless it is thrown by the container's hash function or comparison function.</para>
  1522. </throws>
  1523. </method>
  1524. </method-group>
  1525. <free-function-group name="Equality Comparisons">
  1526. <function name="operator==">
  1527. <template>
  1528. <?php echo $template_value; ?>
  1529. <template-type-parameter name="Hash">
  1530. </template-type-parameter>
  1531. <template-type-parameter name="Pred">
  1532. </template-type-parameter>
  1533. <template-type-parameter name="Alloc">
  1534. </template-type-parameter>
  1535. </template>
  1536. <parameter name="x">
  1537. <paramtype><?php echo $full_type; ?> const&amp;</paramtype>
  1538. </parameter>
  1539. <parameter name="y">
  1540. <paramtype><?php echo $full_type; ?> const&amp;</paramtype>
  1541. </parameter>
  1542. <type>bool</type>
  1543. <description>
  1544. <?php if($equivalent_keys): ?>
  1545. <para>Return <code>true</code> if <code>x.size() ==
  1546. y.size</code> and for every equivalent key group in
  1547. <code>x</code>, there is a group in <code>y</code>
  1548. for the same key, which is a permutation (using
  1549. <code>operator==</code> to compare the value types).
  1550. </para>
  1551. <?php else: ?>
  1552. <para>Return <code>true</code> if <code>x.size() ==
  1553. y.size</code> and for every element in <code>x</code>,
  1554. there is an element in <code>y</code> with the same
  1555. for the same key, with an equal value (using
  1556. <code>operator==</code> to compare the value types).
  1557. </para>
  1558. <?php endif; ?>
  1559. </description>
  1560. <notes>
  1561. <para>The behavior of this function was changed to match
  1562. the C++11 standard in Boost 1.48.</para>
  1563. <para>Behavior is undefined if the two containers don't have
  1564. equivalent equality predicates.</para>
  1565. </notes>
  1566. </function>
  1567. <function name="operator!=">
  1568. <template>
  1569. <?php echo $template_value; ?>
  1570. <template-type-parameter name="Hash">
  1571. </template-type-parameter>
  1572. <template-type-parameter name="Pred">
  1573. </template-type-parameter>
  1574. <template-type-parameter name="Alloc">
  1575. </template-type-parameter>
  1576. </template>
  1577. <parameter name="x">
  1578. <paramtype><?php echo $full_type; ?> const&amp;</paramtype>
  1579. </parameter>
  1580. <parameter name="y">
  1581. <paramtype><?php echo $full_type; ?> const&amp;</paramtype>
  1582. </parameter>
  1583. <type>bool</type>
  1584. <description>
  1585. <?php if($equivalent_keys): ?>
  1586. <para>Return <code>false</code> if <code>x.size() ==
  1587. y.size</code> and for every equivalent key group in
  1588. <code>x</code>, there is a group in <code>y</code>
  1589. for the same key, which is a permutation (using
  1590. <code>operator==</code> to compare the value types).
  1591. </para>
  1592. <?php else: ?>
  1593. <para>Return <code>false</code> if <code>x.size() ==
  1594. y.size</code> and for every element in <code>x</code>,
  1595. there is an element in <code>y</code> with the same
  1596. for the same key, with an equal value (using
  1597. <code>operator==</code> to compare the value types).
  1598. </para>
  1599. <?php endif; ?>
  1600. </description>
  1601. <notes>
  1602. <para>The behavior of this function was changed to match
  1603. the C++11 standard in Boost 1.48.</para>
  1604. <para>Behavior is undefined if the two containers don't have
  1605. equivalent equality predicates.</para>
  1606. </notes>
  1607. </function>
  1608. </free-function-group>
  1609. <free-function-group name="swap">
  1610. <function name="swap">
  1611. <template>
  1612. <?php echo $template_value; ?>
  1613. <template-type-parameter name="Hash">
  1614. </template-type-parameter>
  1615. <template-type-parameter name="Pred">
  1616. </template-type-parameter>
  1617. <template-type-parameter name="Alloc">
  1618. </template-type-parameter>
  1619. </template>
  1620. <parameter name="x">
  1621. <paramtype><?php echo $full_type; ?>&amp;</paramtype>
  1622. </parameter>
  1623. <parameter name="y">
  1624. <paramtype><?php echo $full_type; ?>&amp;</paramtype>
  1625. </parameter>
  1626. <type>void</type>
  1627. <effects>
  1628. <para><code>x.swap(y)</code></para>
  1629. </effects>
  1630. <description>
  1631. <para>Swaps the contents of <code>x</code> and <code>y</code>.</para>
  1632. <para>If <code>Allocator::propagate_on_container_swap</code> is declared and
  1633. <code>Allocator::propagate_on_container_swap::value</code> is true then the
  1634. containers' allocators are swapped. Otherwise, swapping with unequal allocators
  1635. results in undefined behavior.</para>
  1636. </description>
  1637. <throws>
  1638. <para>Doesn't throw an exception unless it is thrown by the copy constructor or copy assignment operator of <code>key_equal</code> or <code>hasher</code>.</para>
  1639. </throws>
  1640. <notes>
  1641. <para>The exception specifications aren't quite the same as the C++11 standard, as
  1642. the equality predieate and hash function are swapped using their copy constructors.</para>
  1643. </notes>
  1644. </function>
  1645. </free-function-group>
  1646. </class>
  1647. <?php
  1648. }
  1649. function echo_node_handle_docs($map)
  1650. {
  1651. $type = $map ? 'map' : 'set';
  1652. $name = 'node_handle_'.$type;
  1653. $full_type = "{$name}&lt;ImplementationDefined&gt;";
  1654. ?>
  1655. <namespace name="unordered">
  1656. <class name="<?php echo $name ?>">
  1657. <template pack="true">
  1658. <template-type-parameter name="ImplementationDefined"/>
  1659. </template>
  1660. <purpose>
  1661. <para>
  1662. An object that owns a single element extracted from an
  1663. <classname>unordered_<?php echo $type ?></classname> or an
  1664. <classname>unordered_multi<?php echo $type ?></classname>, that
  1665. can then be inserted into a compatible container type.
  1666. </para>
  1667. <para>
  1668. The name and template parameters of this type are implementation
  1669. defined, and should be obtained using the <code>node_type</code>
  1670. member typedef from the appropriate container.
  1671. </para>
  1672. </purpose>
  1673. <?php if ($map): ?>
  1674. <typedef name="key_type">
  1675. <type>typename Container::key_type</type>
  1676. </typedef>
  1677. <typedef name="mapped_type">
  1678. <type>typename Container::mapped_type</type>
  1679. </typedef>
  1680. <?php else: ?>
  1681. <typedef name="value_type">
  1682. <type>typename Container::value_type></type>
  1683. </typedef>
  1684. <?php endif ?>
  1685. <typedef name="allocator_type">
  1686. <type>typename Container::allocator_type></type>
  1687. </typedef>
  1688. <constructor specifiers="constexpr" cv="noexcept">
  1689. </constructor>
  1690. <destructor/>
  1691. <constructor cv="noexcept">
  1692. <parameter>
  1693. <paramtype><?php echo $name; ?> &amp;&amp;</paramtype>
  1694. </parameter>
  1695. </constructor>
  1696. <method name="operator=">
  1697. <parameter>
  1698. <paramtype><?php echo $name; ?>&amp;&amp;</paramtype>
  1699. </parameter>
  1700. <type><?php echo $name; ?>&amp;</type>
  1701. </method>
  1702. <?php if ($map): ?>
  1703. <method name="key" cv="const">
  1704. <type>key_type&amp;</type>
  1705. </method>
  1706. <method name="mapped" cv="const">
  1707. <type>mapped_type&amp;</type>
  1708. </method>
  1709. <?php else: ?>
  1710. <method name="value" cv="const">
  1711. <type>value_type&amp;</type>
  1712. </method>
  1713. <?php endif; ?>
  1714. <method name="get_allocator" cv="const">
  1715. <type>allocator_type</type>
  1716. </method>
  1717. <method name="operator bool" specifiers="explicit" cv="const noexcept">
  1718. </method>
  1719. <method name="empty" cv="const noexcept">
  1720. <type>bool</type>
  1721. </method>
  1722. <method name="swap" cv="noexcept(ator_traits::propagate_on_container_swap::value)">
  1723. <parameter>
  1724. <paramtype><?php echo $name; ?>&amp;</paramtype>
  1725. </parameter>
  1726. <type>void</type>
  1727. <notes>
  1728. <para>
  1729. In C++17 is also <code>noexcept</code> if <code>ator_traits::is_always_equal::value</code> is true.
  1730. But we don't support that trait yet.
  1731. </para>
  1732. </notes>
  1733. </method>
  1734. <free-function-group name="swap" cv="noexcept(noexcept(x.swap(y)))">
  1735. <function name="swap">
  1736. <template pack="true">
  1737. <template-type-parameter name="ImplementationDefined"/>
  1738. </template>
  1739. <parameter name="x">
  1740. <paramtype><?php echo $full_type; ?>&amp;</paramtype>
  1741. </parameter>
  1742. <parameter name="y">
  1743. <paramtype><?php echo $full_type; ?>&amp;</paramtype>
  1744. </parameter>
  1745. <type>void</type>
  1746. <effects>
  1747. <para><code>x.swap(y)</code></para>
  1748. </effects>
  1749. </function>
  1750. </free-function-group>
  1751. </class>
  1752. </namespace>
  1753. <?php
  1754. }
  1755. ?>
  1756. <!--
  1757. Copyright Daniel James 2006-2009
  1758. Distributed under the Boost Software License, Version 1.0. (See accompanying
  1759. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  1760. --><library-reference>
  1761. <header name="boost/unordered_set.hpp">
  1762. <namespace name="boost">
  1763. <?php
  1764. echo_unordered_docs(false, false);
  1765. echo_unordered_docs(false, true);
  1766. echo_node_handle_docs(false);
  1767. ?>
  1768. </namespace>
  1769. </header>
  1770. <header name="boost/unordered_map.hpp">
  1771. <namespace name="boost">
  1772. <?php
  1773. echo_unordered_docs(true, false);
  1774. echo_unordered_docs(true, true);
  1775. echo_node_handle_docs(true);
  1776. ?>
  1777. </namespace>
  1778. </header>
  1779. </library-reference>