BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslh::Hash< HASH_ALGORITHM > Struct Template Reference

#include <bslh_hash.h>

Public Types

typedef size_t result_type
 
typedef HASH_ALGORITHM HashAlgorithm
 Make the HASH_ALGORITHM template parameter available to clients.
 

Public Member Functions

 Hash ()=default
 
 Hash (const Hash &original)=default
 
 ~Hash ()=default
 Destroy this object.
 
Hashoperator= (const Hash &rhs)=default
 
template<class TYPE >
result_type operator() (const TYPE &type) const
 
template<class TYPE >
bslh::Hash< HASH_ALGORITHM >::result_type operator() (TYPE const &key) const
 
bslh::Hash< bslh::DefaultHashAlgorithm >::result_type operator() (TYPE const &key) const
 

Detailed Description

template<class HASH_ALGORITHM = bslh::DefaultHashAlgorithm>
struct bslh::Hash< HASH_ALGORITHM >

This struct wraps the (template parameter) type HASH_ALGORITHM in an interface that satisfies the hash requirements of the C++11 standard.

Member Typedef Documentation

◆ HashAlgorithm

template<class HASH_ALGORITHM = bslh::DefaultHashAlgorithm>
typedef HASH_ALGORITHM bslh::Hash< HASH_ALGORITHM >::HashAlgorithm

◆ result_type

template<class HASH_ALGORITHM = bslh::DefaultHashAlgorithm>
typedef size_t bslh::Hash< HASH_ALGORITHM >::result_type

The type of the hash value that will be returned by the function-call operator.

Constructor & Destructor Documentation

◆ Hash() [1/2]

template<class HASH_ALGORITHM = bslh::DefaultHashAlgorithm>
bslh::Hash< HASH_ALGORITHM >::Hash ( )
default

◆ Hash() [2/2]

template<class HASH_ALGORITHM = bslh::DefaultHashAlgorithm>
bslh::Hash< HASH_ALGORITHM >::Hash ( const Hash< HASH_ALGORITHM > &  original)
default

Create a bslh::Hash object. Note that as bslh::Hash is an empty (stateless) type, this operation will have no observable effect.

◆ ~Hash()

template<class HASH_ALGORITHM = bslh::DefaultHashAlgorithm>
bslh::Hash< HASH_ALGORITHM >::~Hash ( )
default

Member Function Documentation

◆ operator()() [1/2]

template<class HASH_ALGORITHM = bslh::DefaultHashAlgorithm>
template<class TYPE >
result_type bslh::Hash< HASH_ALGORITHM >::operator() ( const TYPE &  type) const

Returns a hash value generated by the (template parameter) type HASH_ALGORITHM for the specified type. The value returned by the HASH_ALGORITHM is cast to size_t before returning.

◆ operator()() [2/2]

bslh::Hash< bslh::DefaultHashAlgorithm >::result_type bslh::Hash< bslh::DefaultHashAlgorithm >::operator() ( TYPE const &  key) const
inline

◆ operator=()

template<class HASH_ALGORITHM = bslh::DefaultHashAlgorithm>
Hash & bslh::Hash< HASH_ALGORITHM >::operator= ( const Hash< HASH_ALGORITHM > &  rhs)
default

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object. Note that as bslh::Hash is an empty (stateless) type, this operation will have no observable effect.


The documentation for this struct was generated from the following file: