16 static constexpr size_t getId(std::source_location
const location = std::source_location::current())
18 return generate(location);
22 static constexpr size_t generate(std::source_location
const& location)
24 size_t hash = 0xc6a4'a793'5bd1'e995;
25 hashCombine(hash, location.file_name());
26 hashCombine(hash, location.function_name());
27 hashCombine(hash, location.line());
28 hashCombine(hash,
static_cast<size_t>(location.column()) << 32u);
32 static constexpr void hashCombine(
size_t& seed, std::string_view value)
36 seed ^=
static_cast<size_t>(c) + 0x9e37'79b9 + (seed << 6) + (seed >> 2);
40 static constexpr void hashCombine(
size_t& seed,
size_t value)
42 seed ^= value + 0x9e37'79b9 + (seed << 6) + (seed >> 2);