mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-31 03:47:16 +02:00
Update reference docs for extract()
to include heterogeneous overload
This commit is contained in:
32
doc/ref.php
32
doc/ref.php
@ -953,6 +953,38 @@ EOL;
|
|||||||
</para>
|
</para>
|
||||||
</notes>
|
</notes>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="extract">
|
||||||
|
<template>
|
||||||
|
<template-type-parameter name="K" />
|
||||||
|
</template>
|
||||||
|
<parameter name="k">
|
||||||
|
<paramtype>K&&</paramtype>
|
||||||
|
</parameter>
|
||||||
|
<type>node_type</type>
|
||||||
|
<description>
|
||||||
|
<para>Removes an element with key equivalent to <code>k</code>.</para>
|
||||||
|
<para>
|
||||||
|
This overload only participates in overload resolution if <code>Hash::is_transparent</code>
|
||||||
|
and <code>Pred::is_transparent</code> are valid member typedefs and neither <code>iterator</code>
|
||||||
|
nor <code>const_iterator</code> are implicitly convertible from <code>K</code>. The library
|
||||||
|
assumes that <code>Hash</code> is callable with both <code>K</code> and <code>Key</code> and
|
||||||
|
that <code>Pred</code> is transparent. This enables heterogeneous lookup which avoids the cost of
|
||||||
|
instantiating an instance of the <code>Key</code> type.
|
||||||
|
</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">
|
<method name="insert">
|
||||||
<parameter name="nh">
|
<parameter name="nh">
|
||||||
<paramtype>node_type&&</paramtype>
|
<paramtype>node_type&&</paramtype>
|
||||||
|
Reference in New Issue
Block a user