diff options
author | breakneck <breakneck@yandex-team.ru> | 2022-02-10 16:47:58 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:58 +0300 |
commit | f860932520ce9bc8540a3c19e84c0109c3437dc5 (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /util/str_stl.h | |
parent | e2021f9a0e54d13b7c48796318b13b66dc625e74 (diff) | |
download | ydb-f860932520ce9bc8540a3c19e84c0109c3437dc5.tar.gz |
Restoring authorship annotation for <breakneck@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/str_stl.h')
-rw-r--r-- | util/str_stl.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/util/str_stl.h b/util/str_stl.h index 994ce78cea..f1e137181d 100644 --- a/util/str_stl.h +++ b/util/str_stl.h @@ -111,36 +111,36 @@ struct THash<std::type_index> { } }; -namespace NHashPrivate { - template <typename T> - Y_FORCE_INLINE static size_t HashObject(const T& val) { - return THash<T>()(val); - } - - template <size_t I, bool IsLastElement, typename... TArgs> - struct TupleHashHelper { - Y_FORCE_INLINE static size_t Hash(const std::tuple<TArgs...>& tuple) { - return CombineHashes(HashObject(std::get<I>(tuple)), +namespace NHashPrivate { + template <typename T> + Y_FORCE_INLINE static size_t HashObject(const T& val) { + return THash<T>()(val); + } + + template <size_t I, bool IsLastElement, typename... TArgs> + struct TupleHashHelper { + Y_FORCE_INLINE static size_t Hash(const std::tuple<TArgs...>& tuple) { + return CombineHashes(HashObject(std::get<I>(tuple)), TupleHashHelper<I + 1, I + 2 >= sizeof...(TArgs), TArgs...>::Hash(tuple)); - } - }; - - template <size_t I, typename... TArgs> - struct TupleHashHelper<I, true, TArgs...> { - Y_FORCE_INLINE static size_t Hash(const std::tuple<TArgs...>& tuple) { - return HashObject(std::get<I>(tuple)); - } - }; - + } + }; + + template <size_t I, typename... TArgs> + struct TupleHashHelper<I, true, TArgs...> { + Y_FORCE_INLINE static size_t Hash(const std::tuple<TArgs...>& tuple) { + return HashObject(std::get<I>(tuple)); + } + }; + } - -template <typename... TArgs> -struct THash<std::tuple<TArgs...>> { - size_t operator()(const std::tuple<TArgs...>& tuple) const { - return NHashPrivate::TupleHashHelper<0, 1 >= sizeof...(TArgs), TArgs...>::Hash(tuple); - } -}; - + +template <typename... TArgs> +struct THash<std::tuple<TArgs...>> { + size_t operator()(const std::tuple<TArgs...>& tuple) const { + return NHashPrivate::TupleHashHelper<0, 1 >= sizeof...(TArgs), TArgs...>::Hash(tuple); + } +}; + template <class T> struct THash: public ::hash<T> { }; |