BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlb::TransparentStringHash Struct Reference

#include <bdlb_transparentstringhash.h>

Detailed Description

This struct defines a hash operation for different string types, enabling them for use for heterogeneous lookup in the standard associative containers such as bsl::unordered_map.

Note
Note that this class is an empty POD type.

See bdlb_transparentstringhash

Public Types

typedef void is_transparent
 

Public Member Functions

 TransparentStringHash ()=default
 
 TransparentStringHash (const TransparentStringHash &original)=default
 
 ~TransparentStringHash ()=default
 
TransparentStringHashoperator= (const TransparentStringHash &rhs)=default
 
template<class CHAR >
std::size_t operator() (const CHAR *str) const
 
template<class CHAR , class TRAITS , class ALLOCATOR >
std::size_t operator() (const bsl::basic_string< CHAR, TRAITS, ALLOCATOR > &str) const
 
template<class CHAR , class TRAITS , class ALLOCATOR >
std::size_t operator() (const std::basic_string< CHAR, TRAITS, ALLOCATOR > &str) const
 
template<class CHAR , class TRAITS >
std::size_t operator() (const bsl::basic_string_view< CHAR, TRAITS > &str) const
 

Member Typedef Documentation

◆ is_transparent

Type alias indicating this is a transparent hash functor.

Constructor & Destructor Documentation

◆ TransparentStringHash() [1/2]

bdlb::TransparentStringHash::TransparentStringHash ( )
default

Create a TransparentStringHash object.

◆ TransparentStringHash() [2/2]

bdlb::TransparentStringHash::TransparentStringHash ( const TransparentStringHash original)
default

Create a TransparentStringHash object.

Note
Note that as TransparentStringHash is an empty (stateless) type, this operation has no observable effect.

◆ ~TransparentStringHash()

bdlb::TransparentStringHash::~TransparentStringHash ( )
default

Destroy this object.

Member Function Documentation

◆ operator()() [1/4]

template<class CHAR , class TRAITS , class ALLOCATOR >
std::size_t bdlb::TransparentStringHash::operator() ( const bsl::basic_string< CHAR, TRAITS, ALLOCATOR > &  str) const
inline

◆ operator()() [2/4]

template<class CHAR , class TRAITS >
std::size_t bdlb::TransparentStringHash::operator() ( const bsl::basic_string_view< CHAR, TRAITS > &  str) const
inline

◆ operator()() [3/4]

template<class CHAR >
std::size_t bdlb::TransparentStringHash::operator() ( const CHAR *  str) const
inline

Return a hash code generated from the contents of the specified str.

◆ operator()() [4/4]

template<class CHAR , class TRAITS , class ALLOCATOR >
std::size_t bdlb::TransparentStringHash::operator() ( const std::basic_string< CHAR, TRAITS, ALLOCATOR > &  str) const
inline

◆ operator=()

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

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

Note
Note that as TransparentStringHash is an empty (stateless) type, this operation has no observable effect.

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