summaryrefslogtreecommitdiffstats
path: root/include/rtl/ref.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'include/rtl/ref.hxx')
-rw-r--r--include/rtl/ref.hxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/rtl/ref.hxx b/include/rtl/ref.hxx
index 437f7a34fc05..73c03ff7657d 100644
--- a/include/rtl/ref.hxx
+++ b/include/rtl/ref.hxx
@@ -23,6 +23,8 @@
#include "sal/config.h"
#include <cassert>
+#include <cstddef>
+#include <functional>
#include "sal/types.h"
@@ -250,6 +252,28 @@ public:
} // namespace rtl
+#if defined LIBO_INTERNAL_ONLY
+namespace std
+{
+
+/// @cond INTERNAL
+/**
+ Make rtl::Reference hashable by default for use in STL containers.
+
+ @since LibreOffice 6.3
+*/
+template<typename T>
+struct hash<::rtl::Reference<T>>
+{
+ std::size_t operator()(::rtl::Reference<T> const & s) const
+ { return std::size_t(s.get()); }
+};
+/// @endcond
+
+}
+
+#endif
+
#endif /* ! INCLUDED_RTL_REF_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */