diff options
author | Ruslan Kovalev <[email protected]> | 2022-02-10 16:46:45 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:45 +0300 |
commit | 9123176b341b6f2658cff5132482b8237c1416c8 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /util/generic/variant.h | |
parent | 59e19371de37995fcb36beb16cd6ec030af960bc (diff) |
Restoring authorship annotation for Ruslan Kovalev <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/generic/variant.h')
-rw-r--r-- | util/generic/variant.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/util/generic/variant.h b/util/generic/variant.h index 9c889696234..749fc750908 100644 --- a/util/generic/variant.h +++ b/util/generic/variant.h @@ -1,18 +1,18 @@ #pragma once #include "hash.h" - + #include <variant> - -template <class... Ts> + +template <class... Ts> struct THash<std::variant<Ts...>> { -public: +public: size_t operator()(const std::variant<Ts...>& v) const noexcept { return CombineHashes( IntHash(v.index()), v.valueless_by_exception() ? 0 : std::visit([](const auto& value) { return ComputeHash(value); }, v)); - } -}; + } +}; template <> struct THash<std::monostate> { |