[#BloombergLP-bslstl-HashTable_HashWrapper-03] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::HashTable_HashWrapper :relfileprefix: ../../ :mrdocs: This class provides a wrapper around a functor satisfying the `Hash` requirements ({`bslstl_hash`}) such that the function call operator is always declared as `const` qualified. == Synopsis Declared in `<bslstl_hashtable.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class FUNCTOR> class HashTable_HashWrapper; ---- == Description TBD Provide an optimization for the case of an empty base functor, where we can safely const_cast want calling the base class operator. Note that we would only one class, not two, with C++11 variadic templates and perfect forwarding, and we could also easily detect whether or not `FUNCTOR` provided a const‐qualified `operator()`. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/HashTable_HashWrapper-03/2constructor-00.adoc[`HashTable_HashWrapper`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bslstl/HashTable_HashWrapper-03/functor.adoc[`functor`] | Return a reference providing non‐modifiable access to the hash functor wrapped by this object. | xref:BloombergLP/bslstl/HashTable_HashWrapper-03/operator_call.adoc[`operator()`] | Call the wrapped `functor` with the specified `arg` and return the result. Note that `ARG_TYPE` will typically be deduced as a `const` type. | xref:BloombergLP/bslstl/HashTable_HashWrapper-03/swap.adoc[`swap`] | Exchange the value of this object with the specified `other` object. |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/HashTable_HashWrapper-02.adoc[`HashTable_HashWrapper<FUNCTOR const>`] | This partial specialization handles `const` qualified functors, that may not be stored as a `mutable` member in the primary template. The need to wrap such functors diminishes greatly, as there is no need to play mutable tricks to invoke the function call operator. An alternative to providing this specialization would be to skip the wrapper entirely if using a `const` qualified functor in a `HashTable`. Note that this type has a `const` qualified data member, so is neither assignable nor swappable. | xref:BloombergLP/bslstl/HashTable_HashWrapper-0d.adoc[`HashTable_HashWrapper<FUNCTOR&>`] | This partial specialization handles `const` qualified functors, that may not be stored as a `mutable` member in the primary template. Note that the `FUNCTOR` type itself may be `const`‐qualified, so this one partial template specialization also handles `const FUNCTOR&` references. In order to correctly parse with the reference‐binding rules, we drop the `const` in front of many of the references to `FUNCTOR` seen in the primary template definition. Note that this type has a reference data member, so is not default constructible, assignable or swappable. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslstl/swap-040.adoc[`swap`] | Swap the functor wrapped by the specified `a` object with the functor wrapped by the specified `b` object. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#