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