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