From 893aa969d53be19a6fca5ee9749cbd49abce1d5c Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Tue, 2 Jun 2020 16:03:47 +0200 Subject: [PATCH] Make BorrowedPtr hashable. --- src/Memory/BorrowedPtr.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Memory/BorrowedPtr.hpp b/src/Memory/BorrowedPtr.hpp index b7a2d7d..438c711 100644 --- a/src/Memory/BorrowedPtr.hpp +++ b/src/Memory/BorrowedPtr.hpp @@ -52,4 +52,12 @@ namespace ArbUt { }; } +namespace std { + + template struct hash> { + std::size_t operator()(const ArbUt::BorrowedPtr& k) const { return (size_t)k.GetRaw(); } + }; + +} + #endif // ARBUTILS_BORROWEDPTR_HPP