summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-10-27 11:27:21 -0500
committerDave Parks <davep@lindenlab.com>2022-10-27 11:27:21 -0500
commit0451d51f4da9780e2f650b67672a29b3d07cb386 (patch)
treef8b559b6b7389f82a1239715f6aa1ae6d74eaa47 /indra/llcommon
parenteb4581edf27a19641e3cd29c54a161548544fbeb (diff)
SL-18459 WIP -- fix for assert in setGLTFMaterial
Diffstat (limited to 'indra/llcommon')
-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