diff options
author | eeight <eeight@yandex-team.ru> | 2022-02-10 16:46:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:18 +0300 |
commit | 475c0a46f28166e83fd263badc7546377cddcabe (patch) | |
tree | 39c5a49b8aaad78fe390b6f1f2886bdbda40f3e7 /util/generic/variant.h | |
parent | a6e0145a095c7bb3770d6e07aee301de5c73f96e (diff) | |
download | ydb-475c0a46f28166e83fd263badc7546377cddcabe.tar.gz |
Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/variant.h')
-rw-r--r-- | util/generic/variant.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/generic/variant.h b/util/generic/variant.h index 749fc75090..080f0a6e7e 100644 --- a/util/generic/variant.h +++ b/util/generic/variant.h @@ -1,23 +1,23 @@ #pragma once -#include "hash.h" +#include "hash.h" -#include <variant> +#include <variant> template <class... Ts> -struct THash<std::variant<Ts...>> { +struct THash<std::variant<Ts...>> { 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)); + 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> { +struct THash<std::monostate> { public: - constexpr size_t operator()(std::monostate) const noexcept { + constexpr size_t operator()(std::monostate) const noexcept { return 1; } }; |