|
template<StdHashable Type> |
constexpr auto | operator() (const Type &value) const noexcept(detail::kIsNoexceptHashable< Type >) -> std::size_t |
| Hashes an object that can be hashed using std::hash.
|
|
template<typename Char >
requires std::same_as<std::remove_cv_t<Char>, char> || std::same_as<std::remove_cv_t<Char>, wchar_t> || std::same_as<std::remove_cv_t<Char>, char8_t> || std::same_as<std::remove_cv_t<Char>, char16_t> || std::same_as<std::remove_cv_t<Char>, char32_t> |
constexpr auto | operator() (Char *string) const noexcept -> std::size_t |
| Calculates a hash value for a null-terminated string.
|
|
template<typename First , typename Second > |
constexpr auto | operator() (const std::pair< First, Second > &value) const noexcept(detail::kIsNoexceptHashable< std::pair< First, Second > >) -> std::size_t |
| Calculates a hash value for an std::pair.
|
|
template<typename... Types> |
constexpr auto | operator() (const std::tuple< Types... > &tuple) const noexcept(detail::kIsNoexceptHashable< std::tuple< Types... > >) -> std::size_t |
| Calculates a hash value for an std::tuple.
|
|
template<typename First , typename Second , typename... More> |
constexpr auto | operator() (const First &first, const Second &second, const More &... more) const noexcept(detail::kIsNoexceptHashable< std::tuple< First, Second, More... > >) -> std::size_t |
| Combines the hash values of two or more objects.
|
|
A hash object with extended functionality.
This has object differs in a number of ways from std::hash:
- This object is transparent, meaning that the object itself is not a template. This allows heterogeneous lookup in C++20, where the key used to look up the value does not have to be the same type as the key. You can, for example, look up an entry in a hash table that uses std::string as a key using an std::string_view.
- This object hashes
char *
, const char *
, wchar_t *
, const wchar_t *
, char8_t *
, const char8_t *
, char16_t *
, const char16_t *
, char32_t *
, and const char32_t *
as their std::basic_string_view equivalents
- This class can hash std::pair and std::tuple, if all the members can be hashed
- This class has amulti-parameter operator()() that takes multiple values and combines their hash values