#pragma once #include #include #include #include #include namespace NYql { #ifndef NDEBUG size_t VaryingHash(size_t src); #else inline size_t VaryingHash(size_t src) { return src; } #endif template > struct TVaryingHash { THasher Underlying; TVaryingHash() = default; TVaryingHash(const TVaryingHash&) = default; TVaryingHash(const THasher& underlying) : Underlying(underlying) {} TVaryingHash& operator=(const TVaryingHash& other) = default; size_t operator()(const T& elem) const { return VaryingHash(Underlying(elem)); } }; template , class TEqual = std::equal_to, class TAlloc = std::allocator>> using TVaryingUnorderedMap = std::unordered_map, TEqual, TAlloc>; template , class TEqual = std::equal_to, class TAlloc = std::allocator>> using TVaryingUnorderedMultiMap = std::unordered_multimap, TEqual, TAlloc>; template , class TEqual = std::equal_to, class TAlloc = std::allocator> using TVaryingUnorderedSet = std::unordered_set, TEqual, TAlloc>; template , class TEqual = std::equal_to, class TAlloc = std::allocator> using TVaryingUnorderedMultiSet = std::unordered_multiset, TEqual, TAlloc>; template , class TEqual = TEqualTo, class TAlloc = std::allocator>> using TVaryingHashMap = THashMap, TEqual, TAlloc>; template , class TEqual = TEqualTo, class TAlloc = std::allocator>> using TVaryingHashMultiMap = THashMultiMap, TEqual, TAlloc>; template , class TEqual = TEqualTo, class TAlloc = std::allocator> using TVaryingHashSet = THashSet, TEqual, TAlloc>; template , class TEqual = TEqualTo, class TAlloc = std::allocator> using TVaryingHashMultiSet = THashMultiSet, TEqual, TAlloc>; } // namespace NYql