diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
commit | 9123176b341b6f2658cff5132482b8237c1416c8 (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /util/generic/variant.h | |
parent | 59e19371de37995fcb36beb16cd6ec030af960bc (diff) | |
download | ydb-9123176b341b6f2658cff5132482b8237c1416c8.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. 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 9c88969623..749fc75090 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> { |