[#bsl-hash-06] = xref:bsl.adoc[bsl]::hash :relfileprefix: ../ :mrdocs: Empty base class for hashing. This class, and all explicit and partial specializations of this class, shall conform to the C++11 Hash Requirements (C++11 17.6.3.4, [hash.requirements]). Unless this template is explicitly specialized, it will use the default hash algorithm provided by `bslh::Hash<>` to supply hash values. In order to hash a user‐defined type using `bsl::hash`, `bsl::hash` must be explicitly specialized for the type, or, preferably, `hashAppend` must be implemented for the type. For more details on `hashAppend` and `bslh::Hash` see the component `bslh_hash`. == Synopsis Declared in `<bslstl_hash.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> struct hash : xref:BloombergLP/bslh/Hash-07.adoc[BloombergLP::bslh::Hash<>] ---- == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslh/Hash-07.adoc[BloombergLP::bslh::Hash<>]` | This struct wraps the (template parameter) type `HASH_ALGORITHM` in an interface that satisfies the `hash` requirements of the C++11 standard. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslh/Hash-02/HashAlgorithm.adoc[`HashAlgorithm`] | Make the `HASH_ALGORITHM` template parameter available to clients. | xref:BloombergLP/bslh/Hash-02/result_type.adoc[`result_type`] | The type of the hash value that will be returned by the function‐call operator. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/hash-06/operator_call-0a.adoc[`operator()`] | Function call operators |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:bsl/hash-0f5.adoc[`hash<bool>`] | Specialization of `hash` for `bool` values. | xref:bsl/hash-0c5.adoc[`hash<char>`] | Specialization of `hash` for `char` values. | xref:bsl/hash-09.adoc[`hash<std::thread::id>`] | | xref:bsl/hash-0cb.adoc[`hash<int>`] | Specialization of `hash` for `int` values. | xref:bsl/hash-0df.adoc[`hash<long>`] | Specialization of `hash` for `long` values. | xref:bsl/hash-0d8.adoc[`hash<long long>`] | Specialization of `hash` for `long long` values. | xref:bsl/hash-01b.adoc[`hash<short>`] | Specialization of `hash` for `short` values. | xref:bsl/hash-047.adoc[`hash<signed char>`] | Specialization of `hash` for `signed` `char` values. | xref:bsl/hash-0fb.adoc[`hash<unsigned char>`] | Specialization of `hash` for `unsigned` `char` values. | xref:bsl/hash-08.adoc[`hash<unsigned int>`] | Specialization of `hash` for `unsigned` `int` values. | xref:bsl/hash-0c0.adoc[`hash<unsigned long>`] | Specialization of `hash` for `unsigned` `long` values. | xref:bsl/hash-02.adoc[`hash<unsigned long long>`] | Specialization of `hash` for `unsigned` `long long` values. | xref:bsl/hash-0db.adoc[`hash<unsigned short>`] | Specialization of `hash` for `unsigned` `short` values. | xref:bsl/hash-041.adoc[`hash<wchar_t>`] | Specialization of `hash` for `wchar_t` values. | xref:bsl/hash-0b.adoc[`hash<BSLSTL_KEY const>`] | This class provides hashing functionality for constant key types, by delegating to the same function for non‐constant key types. | xref:bsl/hash-017.adoc[`hash<basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>>`] | Specialize `bsl::hash` for strings, including an overload for pointers to allow character arrays to be hashed without converting them first. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:bsl/hash-0b.adoc[`hash<BSLSTL_KEY const>`] | This class provides hashing functionality for constant key types, by delegating to the same function for non‐constant key types. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#