diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
commit | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (patch) | |
tree | 506dac10f5df94fab310584ee51b24fc5a081c22 /contrib/restricted/abseil-cpp/absl/hash/hash.h | |
parent | 2d37894b1b037cf24231090eda8589bbb44fb6fc (diff) | |
download | ydb-4e839db24a3bbc9f1c610c43d6faaaa99824dcca.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/restricted/abseil-cpp/absl/hash/hash.h')
-rw-r--r-- | contrib/restricted/abseil-cpp/absl/hash/hash.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/contrib/restricted/abseil-cpp/absl/hash/hash.h b/contrib/restricted/abseil-cpp/absl/hash/hash.h index 8282ea53c6..d26f1d0a9a 100644 --- a/contrib/restricted/abseil-cpp/absl/hash/hash.h +++ b/contrib/restricted/abseil-cpp/absl/hash/hash.h @@ -73,8 +73,8 @@ #ifndef ABSL_HASH_HASH_H_ #define ABSL_HASH_HASH_H_ -#include <tuple> - +#include <tuple> + #include "absl/hash/internal/hash.h" namespace absl { @@ -216,26 +216,26 @@ ABSL_NAMESPACE_BEGIN template <typename T> using Hash = absl::hash_internal::Hash<T>; -// HashOf -// -// absl::HashOf() is a helper that generates a hash from the values of its -// arguments. It dispatches to absl::Hash directly, as follows: -// * HashOf(t) == absl::Hash<T>{}(t) -// * HashOf(a, b, c) == HashOf(std::make_tuple(a, b, c)) -// -// HashOf(a1, a2, ...) == HashOf(b1, b2, ...) is guaranteed when -// * The argument lists have pairwise identical C++ types -// * a1 == b1 && a2 == b2 && ... -// -// The requirement that the arguments match in both type and value is critical. -// It means that `a == b` does not necessarily imply `HashOf(a) == HashOf(b)` if -// `a` and `b` have different types. For example, `HashOf(2) != HashOf(2.0)`. -template <int&... ExplicitArgumentBarrier, typename... Types> -size_t HashOf(const Types&... values) { - auto tuple = std::tie(values...); - return absl::Hash<decltype(tuple)>{}(tuple); -} - +// HashOf +// +// absl::HashOf() is a helper that generates a hash from the values of its +// arguments. It dispatches to absl::Hash directly, as follows: +// * HashOf(t) == absl::Hash<T>{}(t) +// * HashOf(a, b, c) == HashOf(std::make_tuple(a, b, c)) +// +// HashOf(a1, a2, ...) == HashOf(b1, b2, ...) is guaranteed when +// * The argument lists have pairwise identical C++ types +// * a1 == b1 && a2 == b2 && ... +// +// The requirement that the arguments match in both type and value is critical. +// It means that `a == b` does not necessarily imply `HashOf(a) == HashOf(b)` if +// `a` and `b` have different types. For example, `HashOf(2) != HashOf(2.0)`. +template <int&... ExplicitArgumentBarrier, typename... Types> +size_t HashOf(const Types&... values) { + auto tuple = std::tie(values...); + return absl::Hash<decltype(tuple)>{}(tuple); +} + // HashState // // A type erased version of the hash state concept, for use in user-defined |