EtcPal  HEAD (unstable)
ETC Platform Abstraction Layer (EtcPal)
View other versions:
hash (Hashing Utilities)

Overview

C++ utilities for hashing.

Functions

template<class T >
void HashCombine (size_t &seed, const T &val)
 A function that combines the hash of a new value into an existing seed, based on boost::hash_combine. More...
 

Function Documentation

◆ HashCombine()

void etcpal::HashCombine ( size_t &  seed,
const T &  val 
)
inline

A function that combines the hash of a new value into an existing seed, based on boost::hash_combine.

Example:

int val1 = 1234;
std::string val2("5678");
size_t seed = std::hash<int>()(val1);
etcpal::HashCombine(seed, val2);
// seed now containes a hash uniquely based on the combination of val1 and val2.
void HashCombine(size_t &seed, const T &val)
A function that combines the hash of a new value into an existing seed, based on boost::hash_combine.
Definition: hash.h:52
Parameters
seedThe seed which will be updated.
valThe value to hash and combine into the seed.