| Defined in header |
template <class... Types> struct hash<std::variant<Types...>>;
The template specialization of
std::hash for the
std::variant template allows users to obtain hashes of
std::hash<std::variant<Types...>> is enabled (see
std::hash) if every specialization in
std::hash<std::remove_const_t<Types>>... is enabled, and is disabled otherwise.
The member functions of this specialization are not guaranteed to be noexcept.
|Types||-|| the types of the alternatives supported by the
std::hash<std::optional>, hash of a variant does not typically equal the hash of the contained value; this makes it possible to distinguish
std::variant<int, int> holding the same value as different alternatives.
| hash function object
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.