mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
begenning the refactor
This commit is contained in:
29
runtime/Includes/Utils/CombineHash.h
git.filemode.normal_file
29
runtime/Includes/Utils/CombineHash.h
git.filemode.normal_file
@@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* 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
|
||||
Reference in New Issue
Block a user