BsUtil.h 382 B

1234567891011121314151617
  1. #pragma once
  2. #include "BsPrerequisitesUtil.h"
  3. namespace BansheeEngine
  4. {
  5. /**
  6. * @brief Generates a new hash for the provided type using the default standard
  7. * hasher and combines it with a previous hash.
  8. */
  9. template <class T>
  10. inline void hash_combine(std::size_t& seed, const T& v)
  11. {
  12. std::hash<T> hasher;
  13. seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
  14. }
  15. }