summaryrefslogtreecommitdiff
path: root/indra/llcommon/llpointer.h
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-29 10:45:43 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2023-11-29 10:45:43 +0200
commitd1c0a5b840e9ec2d3a468216339ae5367aed4bf5 (patch)
tree30a47a8bf5ba4561c0f6d3839afd1a9f35dac873 /indra/llcommon/llpointer.h
parent6f99a844efe4e7809ed0a995b0118851e6f0d8d5 (diff)
parent53e958a2638705572ed7dbf61369d92b332c4b60 (diff)
Merge branch 'DRTVWR-559' into marchcat/587-v-pbr-merge
# Conflicts: # indra/llcommon/CMakeLists.txt # indra/newview/llspatialpartition.cpp # indra/newview/llviewergenericmessage.cpp # indra/newview/llvoavatar.cpp
Diffstat (limited to 'indra/llcommon/llpointer.h')
-rw-r--r--indra/llcommon/llpointer.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h
index 9a6453ea48..f9de0c7929 100644
--- a/indra/llcommon/llpointer.h
+++ b/indra/llcommon/llpointer.h
@@ -340,4 +340,28 @@ private:
bool mStayUnique;
};
+
+// boost hash adapter
+template <class Type>
+struct boost::hash<LLPointer<Type>>
+{
+ typedef LLPointer<Type> argument_type;
+ typedef std::size_t result_type;
+ result_type operator()(argument_type const& s) const
+ {
+ return (std::size_t) s.get();
+ }
+};
+
+// Adapt boost hash to std hash
+namespace std
+{
+ template<class Type> struct hash<LLPointer<Type>>
+ {
+ std::size_t operator()(LLPointer<Type> const& s) const noexcept
+ {
+ return boost::hash<LLPointer<Type>>()(s);
+ }
+ };
+}
#endif