diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:44 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:44 +0300 |
commit | 59e19371de37995fcb36beb16cd6ec030af960bc (patch) | |
tree | fa68e36093ebff8b805462e9e6d331fe9d348214 /util/generic/variant.h | |
parent | 89db6fe2fe2c32d2a832ddfeb04e8d078e301084 (diff) | |
download | ydb-59e19371de37995fcb36beb16cd6ec030af960bc.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 1 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 749fc750908..9c889696234 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> { |