<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>
<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>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>
<para>Constructs an container, copying <code>x</code>'s contained elements, hash function, predicate, maximum load factor, but using allocator <code>a</code>.</para>
<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>
<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
<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
<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>
<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>
<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>
<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>
<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>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>
<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="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>
<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>
<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>
<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>
<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>
<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>
<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>