BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlb::CStringHash Struct Reference

#include <bdlb_cstringhash.h>

Public Types

typedef const char * argument_type
 
typedef bsl::size_t result_type
 

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (CStringHash, bsl::is_trivially_copyable)
 
 BSLMF_NESTED_TRAIT_DECLARATION (CStringHash, bsl::is_trivially_default_constructible)
 
 CStringHash ()=default
 Create a CStringHash object.
 
 CStringHash (const CStringHash &original)=default
 
 ~CStringHash ()=default
 Destroy this object.
 
CStringHashoperator= (const CStringHash &rhs)=default
 
bsl::size_t operator() (const char *argument) const
 

Detailed Description

This struct defines a hash operation for null-terminated character strings enabling them to be used as keys in the standard unordered associative containers such as bsl::unordered_map and bsl::unordered_set. Note that this class is an empty POD type.

Member Typedef Documentation

◆ argument_type

typedef const char* bdlb::CStringHash::argument_type

◆ result_type

typedef bsl::size_t bdlb::CStringHash::result_type

Constructor & Destructor Documentation

◆ CStringHash() [1/2]

bdlb::CStringHash::CStringHash ( )
default

◆ CStringHash() [2/2]

bdlb::CStringHash::CStringHash ( const CStringHash original)
default

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

◆ ~CStringHash()

bdlb::CStringHash::~CStringHash ( )
default

Member Function Documentation

◆ BSLMF_NESTED_TRAIT_DECLARATION() [1/2]

bdlb::CStringHash::BSLMF_NESTED_TRAIT_DECLARATION ( CStringHash  ,
bsl::is_trivially_copyable   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION() [2/2]

bdlb::CStringHash::BSLMF_NESTED_TRAIT_DECLARATION ( CStringHash  ,
bsl::is_trivially_default_constructible   
)

◆ operator()()

bsl::size_t bdlb::CStringHash::operator() ( const char *  argument) const
inline

Return a hash code generated from the contents of the specified null-terminated argument string. The behavior is undefined unless argument points to a null-terminated string.

◆ operator=()

CStringHash & bdlb::CStringHash::operator= ( const CStringHash rhs)
default

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


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