Files
cppdraft_translate/cppdraft/variant/hash.md
2025-10-25 03:02:53 +03:00

33 lines
961 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[variant.hash]
# 22 General utilities library [[utilities]](./#utilities)
## 22.6 Variants [[variant]](variant#hash)
### 22.6.12 Hash support [variant.hash]
[🔗](#lib:hash,variant)
`template<class... Types> struct hash<variant<Types...>>;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L6999)
The specialization hash<variant<Types...>> is enabled ([[unord.hash]](unord.hash "22.10.19Class template hash"))
if and only if every specialization in hash<remove_const_t<Types>>... is enabled[.](#1.sentence-1)
The member functions are not guaranteed to be noexcept[.](#1.sentence-2)
[🔗](#lib:hash,monostate)
`template<> struct hash<monostate>;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L7011)
The specialization is enabled ([[unord.hash]](unord.hash "22.10.19Class template hash"))[.](#2.sentence-1)