8#ifndef INCLUDED_BSLSTP_HASH
9#define INCLUDED_BSLSTP_HASH
93#include <bslscm_version.h>
104#ifndef BDE_OMIT_INTERNAL_DEPRECATED
105#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
121template <
class HASH_KEY>
struct Hash;
123template <>
struct Hash<char>;
124template <>
struct Hash<signed char>;
125template <>
struct Hash<unsigned char>;
126template <>
struct Hash<short>;
127template <>
struct Hash<unsigned short>;
128template <>
struct Hash<int>;
129template <>
struct Hash<unsigned int>;
130template <>
struct Hash<long>;
131template <>
struct Hash<unsigned long>;
132template <>
struct Hash<long long>;
133template <>
struct Hash<unsigned long long>;
146template <
class HASH_KEY>
150 typedef ::bsl::hash<HASH_KEY>
Type;
157template <
class HASH_KEY>
242 unsigned long result = 0;
245 result = 5 * result + *s;
248 return std::size_t(result);
400#ifdef BSLS_PLATFORM_CPU_64_BIT
403struct Hash<long long> {
411 std::size_t operator()(
long long x)
const
419struct Hash<unsigned long long> {
427 std::size_t operator()(
unsigned long long x)
const
446 return (std::size_t)(x ^ (x >> 32));
451struct Hash<unsigned long long> {
461 return (std::size_t)(x ^ (x >> 32));
#define BSLMF_NESTED_TRAIT_DECLARATION(t_TYPE, t_TRAIT)
Definition bslmf_nestedtraitdeclaration.h:231
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bslstp_exfunctional.h:325
Definition bslmf_istriviallycopyable.h:324
Definition bslstp_hash.h:232
std::size_t operator()(const char *s) const
Return a hash value computed using the specified s.
Definition bslstp_hash.h:240
BSLMF_NESTED_TRAIT_DECLARATION(HashCString, bsl::is_trivially_copyable)
Hash< char > Type
Definition bslstp_hash.h:171
HashSelector< HASH_KEY >::Type Type
Definition bslstp_hash.h:161
HashCString Type
Definition bslstp_hash.h:166
Hash< int > Type
Definition bslstp_hash.h:196
Hash< long > Type
Definition bslstp_hash.h:206
Hash< long long > Type
Definition bslstp_hash.h:216
Hash< short > Type
Definition bslstp_hash.h:186
Hash< signed char > Type
Definition bslstp_hash.h:176
Hash< unsigned char > Type
Definition bslstp_hash.h:181
Hash< unsigned int > Type
Definition bslstp_hash.h:201
Hash< unsigned long > Type
Definition bslstp_hash.h:211
Hash< unsigned long long > Type
Definition bslstp_hash.h:221
Hash< unsigned short > Type
Definition bslstp_hash.h:191
Definition bslstp_hash.h:147
::bsl::hash< HASH_KEY > Type
Definition bslstp_hash.h:150
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
std::size_t operator()(char x) const
Return a hash value computed using the specified x.
Definition bslstp_hash.h:266
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
std::size_t operator()(int x) const
Return a hash value computed using the specified x.
Definition bslstp_hash.h:346
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
std::size_t operator()(long x) const
Return a hash value computed using the specified x.
Definition bslstp_hash.h:378
std::size_t operator()(unsigned long long x) const
Definition bslstp_hash.h:443
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
std::size_t operator()(short x) const
Return a hash value computed using the specified x.
Definition bslstp_hash.h:314
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
std::size_t operator()(signed char x) const
Return a hash value computed using the specified x.
Definition bslstp_hash.h:298
std::size_t operator()(unsigned char x) const
Return a hash value computed using the specified x.
Definition bslstp_hash.h:282
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
std::size_t operator()(unsigned int x) const
Return a hash value computed using the specified x.
Definition bslstp_hash.h:362
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
std::size_t operator()(unsigned long x) const
Return a hash value computed using the specified x.
Definition bslstp_hash.h:394
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
std::size_t operator()(unsigned long long x) const
Definition bslstp_hash.h:458
BSLMF_NESTED_TRAIT_DECLARATION(Hash, bsl::is_trivially_copyable)
std::size_t operator()(unsigned short x) const
Return a hash value computed using the specified x.
Definition bslstp_hash.h:330
Definition bslstp_hash.h:121