Clio develop
The XRP Ledger API server.
|
A string hash functor that provides transparent hash operations for various string types. More...
#include <StringHash.hpp>
Public Types | |
using | hash_type = std::hash<std::string_view> |
using | is_transparent = void |
Enables heterogeneous lookup. | |
Public Member Functions | |
std::size_t | operator() (char const *str) const |
Computes the hash of a C-style string. | |
std::size_t | operator() (std::string_view str) const |
Computes the hash of a string_view. | |
std::size_t | operator() (std::string const &str) const |
Computes the hash of a standard string. | |
A string hash functor that provides transparent hash operations for various string types.
This hash functor can be used with unordered containers to enable heterogeneous lookups for different string-like types without unnecessary conversions. It supports C-style strings, string views, and standard strings.
size_t util::StringHash::operator() | ( | char const * | str | ) | const |
Computes the hash of a C-style string.
str | Null-terminated C-style string to hash |
size_t util::StringHash::operator() | ( | std::string const & | str | ) | const |
Computes the hash of a standard string.
str | String to hash |
size_t util::StringHash::operator() | ( | std::string_view | str | ) | const |
Computes the hash of a string_view.
str | String view to hash |