[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.19 Class 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.19 Class template hash"))[.](#2.sentence-1)
