diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-29 19:34:39 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-29 19:34:39 +0300 |
commit | b6441bf09b9058a799e7581878ee21007323ee0c (patch) | |
tree | bad6f8f26b83643dc0f603a8c774a9ddaedd13c2 /indra/llcommon/lluuid.h | |
parent | de696d0213b98110f930cae35a8db005e3d1a061 (diff) | |
parent | f20b22e325ef15e0aa6eef950ba96538bb015568 (diff) |
Merge branch 'DRTVWR-500' into DRTVWR-501-maint
Diffstat (limited to 'indra/llcommon/lluuid.h')
-rw-r--r-- | indra/llcommon/lluuid.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index dd8660a3c8..fe7482ba29 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -31,6 +31,7 @@ #include <vector> #include "stdtypes.h" #include "llpreprocessor.h" +#include <boost/functional/hash.hpp> class LLMutex; @@ -164,6 +165,25 @@ public: LLAssetID makeAssetID(const LLUUID& session) const; }; +// Generate a hash of an LLUUID object using the boost hash templates. +template <> +struct boost::hash<LLUUID> +{ + typedef LLUUID argument_type; + typedef std::size_t result_type; + result_type operator()(argument_type const& s) const + { + result_type seed(0); + + for (S32 i = 0; i < UUID_BYTES; ++i) + { + boost::hash_combine(seed, s.mData[i]); + } + + return seed; + } +}; + #endif |