Derive-C
Loading...
Searching...
No Matches
combine.h
Go to the documentation of this file.
1#pragma once
2
3#include <stddef.h>
4
6
7DC_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}
static DC_PUBLIC size_t dc_hash_combine(size_t seed, size_t h)
Definition combine.h:7
#define DC_PUBLIC
Definition namespace.h:25