Derive-C
Loading...
Searching...
No Matches
combine.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <stddef.h>
4
5
#include <
derive-c/core/namespace.h
>
6
7
DC_PUBLIC
static
inline
size_t
dc_hash_combine
(
size_t
seed,
size_t
h) {
8
// 0x9e3779b97f4a7c15 is 64-bit fractional part of the golden ratio;
9
// “+ (seed<<6) + (seed>>2)” mixes seed’s bits
10
return
seed ^ (h + 0x9e3779b97f4a7c15ULL + (seed << 6) + (seed >> 2));
11
}
dc_hash_combine
static DC_PUBLIC size_t dc_hash_combine(size_t seed, size_t h)
Definition
combine.h:7
namespace.h
DC_PUBLIC
#define DC_PUBLIC
Definition
namespace.h:25
src
derive-c
algorithm
hash
combine.h
Generated by
1.15.0