Flutter Engine
Loading...
Searching...
No Matches
hash_combine.h
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#ifndef FLUTTER_FML_HASH_COMBINE_H_
6
#define FLUTTER_FML_HASH_COMBINE_H_
7
8
#include <functional>
9
10
namespace
fml
{
11
12
template
<
class
Type>
13
constexpr
void
HashCombineSeed
(std::size_t& seed,
const
Type& arg) {
14
seed ^= std::hash<Type>{}(arg) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
15
}
16
17
template
<
class
Type,
class
... Rest>
18
constexpr
void
HashCombineSeed
(std::size_t& seed,
19
const
Type& arg,
20
const
Rest&... other_args) {
21
HashCombineSeed
(seed, arg);
22
HashCombineSeed
(seed, other_args...);
23
}
24
25
[[nodiscard]]
constexpr
std::size_t
HashCombine
() {
26
return
0xdabbad00;
27
}
28
29
template
<
class
... Type>
30
[[nodiscard]]
constexpr
std::size_t
HashCombine
(
const
Type&...
args
) {
31
std::size_t seed =
HashCombine
();
32
HashCombineSeed
(seed,
args
...);
33
return
seed;
34
}
35
36
}
// namespace fml
37
38
#endif
// FLUTTER_FML_HASH_COMBINE_H_
args
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
Definition
fl_event_channel.h:89
fml
Definition
ascii_trie.cc:9
fml::HashCombine
constexpr std::size_t HashCombine()
Definition
hash_combine.h:25
fml::HashCombineSeed
constexpr void HashCombineSeed(std::size_t &seed, const Type &arg)
Definition
hash_combine.h:13
fml
hash_combine.h
Generated on Wed Nov 5 2025 21:33:12 for Flutter Engine by
1.9.8