A wrapper for keyword names (string literals) that internally stores a 64-bit hash value based on the BKDRHash algorithm.
class KwargsKey;| Name | Description |
|---|---|
KwargsKey |
Constructor. |
| Name | Description |
|---|---|
value_type |
The type of the string hash value; an unsigned 64-bit integer. |
| Name | Description |
|---|---|
value |
Returns the hash value. |
| Name | Description |
|---|---|
operator value_type() |
Implicit conversion to value_type. |
operator== |
Hash value comparison. |
operator!= |
Hash value comparison. |
operator< |
Hash value comparison. |
operator> |
Hash value comparison. |
operator<= |
Hash value comparison. |
operator>= |
Hash value comparison. |
operator|| |
Joins two or more KwargsKey instances. |
The type of the stored hash value. A 64-bit unsigned integer:
using value_type = detail::string_hash_type; // std::uint64_ttemplate<std::size_t _Size>
constexpr KwargsKey(const char (&__str)[_Size]) noexcept;constexpr KwargsKey(const char* const __str, std::size_t __size) noexcept;Tip
The __size does not need to include the null terminator \0. If it does, the \0 will also be hashed.
constexpr explicit KwargsKey(value_type __option) noexcept;Returns the internal hash value.
constexpr value_type value() const noexcept;Allows implicit conversion to value_type.
constexpr operator value_type() const noexcept;Compare based on hash values.
constexpr bool operator==(KwargsKey __other) const noexcept;
constexpr bool operator!=(KwargsKey __other) const noexcept;
constexpr bool operator<(KwargsKey __other) const noexcept;
constexpr bool operator>(KwargsKey __other) const noexcept;
constexpr bool operator<=(KwargsKey __other) const noexcept;
constexpr bool operator>=(KwargsKey __other) const noexcept;Warning
Hash collisions may occur. Two different strings can have the same hash in extremely rare cases. However, identical strings will always produce the same hash.
Combines multiple KwargsKey instances using the or operator.
Supports combining keys using logical OR. See also Kwargs for usage.
friend constexpr std::array<KwargsKey, 2>
operator||(KwargsKey __first, KwargsKey __second) noexcept;
template<std::size_t _StringSize>
friend constexpr std::array<KwargsKey, 2>
operator||(KwargsKey __first, const char (&__second)[_StringSize]) noexcept;
template<std::size_t _Size>
friend constexpr std::array<KwargsKey, _Size + 1>
operator||(const std::array<KwargsKey, _Size>& __first, KwargsKey __second) noexcept;
template<std::size_t _Size, std::size_t _StringSize>
friend constexpr std::array<KwargsKey, _Size + 1>
operator||(const std::array<KwargsKey, _Size>& __first, const char (&__second)[_StringSize]) noexcept;