diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2023-11-30 17:47:58 +0100 |
---|---|---|
committer | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2023-12-05 03:37:06 +0100 |
commit | c9cd5631e4b149f83c5a49c8fbf869cf2fb5b6a7 (patch) | |
tree | d09566a4132530ea65574a886540e0f258103017 /indra/llcommon/llpointer.h | |
parent | 54db4206e9302e7510bc4f103ff59714c1be942d (diff) | |
parent | 683bf84bb38adc88d4a4b7fedaed89b41fcac45e (diff) |
Merge branch 'main' into DRTVWR-489
Diffstat (limited to 'indra/llcommon/llpointer.h')
-rw-r--r-- | indra/llcommon/llpointer.h | 24 |
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 |