Radium Engine  1.5.20
Loading...
Searching...
No Matches
StdUtils.hpp
1#pragma once
2
3#include <Core/RaCore.hpp>
4
5#include <functional>
6
9namespace Ra {
10namespace Core {
11namespace Utils {
15template <typename T>
16void hash_combine( std::size_t& seed, const T& key ) {
17 std::hash<T> hasher;
18 seed ^= hasher( key ) + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 );
19}
20
22template <typename T1, typename T2>
23inline std::size_t hash( const std::pair<T1, T2>& p ) {
24 std::size_t result( 0 );
25 hash_combine( result, p.first );
26 hash_combine( result, p.second );
27 return result;
28}
29} // namespace Utils
30} // namespace Core
31} // namespace Ra
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3