[#BloombergLP-bslstl-HashTable_ComparatorWrapper-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::HashTable&lowbar;ComparatorWrapper
:relfileprefix: ../../
:mrdocs:

This class provides a wrapper around a functor that can compare two values and return a `bool`, so that the function call operator is always declared as `const` qualified&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;hashtable&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FUNCTOR&gt;
class HashTable&lowbar;ComparatorWrapper;
----

== Description

TBD Provide an optimization for the case of an empty base functor, where we can safely const&lowbar;cast want calling the base class operator&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/HashTable_ComparatorWrapper-0e/2constructor-04.adoc[`HashTable&lowbar;ComparatorWrapper`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslstl/HashTable_ComparatorWrapper-0e/functor.adoc[`functor`] 
| Return a reference providing non&hyphen;modifiable access to the hash functor wrapped by this object&period;
| xref:BloombergLP/bslstl/HashTable_ComparatorWrapper-0e/operator_call.adoc[`operator()`] 
| Call the wrapped `functor` with the specified `arg1` and `arg2` (in that order) and return the result&period; Note that `ARGn&lowbar;TYPE` will typically be deduced as a `const` type&period;
| xref:BloombergLP/bslstl/HashTable_ComparatorWrapper-0e/swap.adoc[`swap`] 
| Exchange the value of this object with the specified `other` object&period;
|===


== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/HashTable_ComparatorWrapper-0d.adoc[`HashTable&lowbar;ComparatorWrapper&lt;FUNCTOR const&gt;`] 
| This partial specialization handles `const` qualified functors, that may not be stored as a `mutable` member in the primary template&period; The need to wrap such functors diminishes greatly, as there is no need to play mutable tricks to invoke the function call operator&period; An alternative to providing this specialization would be to skip the wrapper entirely if using a `const` qualified functor in a `HashTable`&period; Note that this type has a `const` qualified data member, so is neither assignable nor swappable&period;
| xref:BloombergLP/bslstl/HashTable_ComparatorWrapper-07.adoc[`HashTable&lowbar;ComparatorWrapper&lt;FUNCTOR&&gt;`] 
| This partial specialization handles `const` qualified functors, that may not be stored as a `mutable` member in the primary template&period; Note that the `FUNCTOR` type itself may be `const`&hyphen;qualified, so this one partial template specialization also handles `const FUNCTOR&amp;` references&period; In order to correctly parse with the reference&hyphen;binding rules, we drop the `const` in front of many of the references to `FUNCTOR` seen in the primary template definition&period; Note that this type has a reference data member, so is not default constructible, assignable or swappable&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/swap-044.adoc[`swap`]
| Swap the functor wrapped by the specified `lhs` object with the functor wrapped by the specified `rhs` object&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
