#include <bdlb_transparentstringhash.h>
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
|
| | TransparentStringHash ()=default |
| |
| | TransparentStringHash (const TransparentStringHash &original)=default |
| |
| | ~TransparentStringHash ()=default |
| |
| TransparentStringHash & | operator= (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 |
| |
◆ is_transparent
Type alias indicating this is a transparent hash functor.
◆ TransparentStringHash() [1/2]
| bdlb::TransparentStringHash::TransparentStringHash |
( |
| ) |
|
|
default |
◆ TransparentStringHash() [2/2]
◆ ~TransparentStringHash()
| bdlb::TransparentStringHash::~TransparentStringHash |
( |
| ) |
|
|
default |
◆ 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=()
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: