summaryrefslogtreecommitdiff
path: root/indra/llcommon/lluuid.h
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2020-04-22 15:34:58 +0100
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2020-04-22 15:34:58 +0100
commit4e75814b44e0a2903e351c0bf6e42a7eae086309 (patch)
treee473712e3d32d12bb8b35752229a81067d7830e8 /indra/llcommon/lluuid.h
parent6219348652846782fe682e13aacd00e5225b35d0 (diff)
parentd7f1c88c35849e56f5b352f13c16a08467d1533b (diff)
Merge remote-tracking branch 'origin/master' into SL-12995
Merge
Diffstat (limited to 'indra/llcommon/lluuid.h')
-rw-r--r--indra/llcommon/lluuid.h20
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