mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
30 lines
1.2 KiB
C++
30 lines
1.2 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* CombineHash.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/12/14 16:16:06 by maldavid #+# #+# */
|
|
/* Updated: 2024/03/27 21:59:30 by maldavid ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef __MLX_HASH__
|
|
#define __MLX_HASH__
|
|
|
|
namespace mlx
|
|
{
|
|
inline void HashCombine([[maybe_unused]] std::size_t& seed) noexcept {}
|
|
|
|
template <typename T, typename... Rest>
|
|
inline void HashCombine(std::size_t& seed, const T& v, Rest... rest)
|
|
{
|
|
std::hash<T> hasher;
|
|
seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
|
|
HashCombine(seed, rest...);
|
|
}
|
|
}
|
|
|
|
#endif
|