Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
 
#pragma once
 
namespace onnxruntime {
 
// Combine hash value `seed` with hash value `h`, updating `seed` in place.
// TODO(edgchen1) find a better implementation? e.g., see a more recent version of boost::hash_combine()
inline void HashCombineWithHashValue(size_t h, size_t& seed) {
  seed ^= h + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
 
// Combine hash value `seed` with the hash value of `value`, updating `seed` in place.
// The hash value computation is specified by the `Hash` template parameter.
template <typename T, typename Hash = std::hash<T>>
inline void HashCombine(const T& value, size_t& seed) {
  HashCombineWithHashValue(Hash{}(value), seed);
}
 
}  // namespace onnxruntime