[#BloombergLP-bslh-Hash_AdlWrapper] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslh.adoc[bslh]::Hash_AdlWrapper :relfileprefix: ../../ :mrdocs: This `class` is a wrapper that is useful in the case of `HASH_ALGORITHM` not being in the `bslh` namespace, which can be problematic for ADL lookup of `bslh::hashAppend`. Wrapping a hash algorithm in this wrapper, which is called inline, effectively forwards the algorithm into the `bslh` namespace. == Synopsis Declared in `<bslh_hash.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class HASH_ALGORITHM> class Hash_AdlWrapper; ---- == Description More detailed explanation: Normally, we define the free functions `hashAppend` in the same namespaces as the types they are hashing, so that ADL will find the function. In cases where this is not possible, such as `std`, we support defining a `hashAppend` overload in the `bslh` namespace instead. This wrapper makes sure that `bslh` is an associated namespace when it is used as the first argument to `hashAppend`, ensuring that such overloads in `bslh` added outside this component are still found via ADL. Without this wrapper, in the cases where the hash algorithm is neither in `bslh` nor in the namespace of the hashed type, ADL then fails to find the function. This wrapper solves this problem by forcibly associating the invocation of `hashAppend`, wherever it may be, with the `bslh` namespace. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslh/Hash_AdlWrapper/result_type.adoc[`result_type`] | Typedef indicating the value type returned by this algorithm. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslh/Hash_AdlWrapper/2constructor.adoc[`Hash_AdlWrapper`] [.small]#[constructor]# | Default construct an instance of the hash algorithm wrapped in this wrapper. | xref:BloombergLP/bslh/Hash_AdlWrapper/computeHash.adoc[`computeHash`] | Forward the call to the identical manipulator of `HASH_ALGORITHM` and cast the return value to 'result_type. | xref:BloombergLP/bslh/Hash_AdlWrapper/operator_call-0f.adoc[`operator()`] | Forward the call to the identical manipulator of `HASH_ALGORITHM`, passing on the specified `input` and `numBytes`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#