From 34a0aa49faf63142b5abc59548941a446902a0a4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 18 May 2023 00:51:27 +0200 Subject: [PATCH] oneTBB: explicitly specify hasher --- pxr/usd/usd/crateFile.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pxr/usd/usd/crateFile.h b/pxr/usd/usd/crateFile.h index 399367e6e0..344f357220 100644 --- a/pxr/usd/usd/crateFile.h +++ b/pxr/usd/usd/crateFile.h @@ -349,12 +349,15 @@ class CrateFile bool operator!=(ZeroCopySource const &other) const { return !(*this == other); } - friend size_t tbb_hasher(ZeroCopySource const &z) { - return TfHash::Combine( - reinterpret_cast(z._addr), - z._numBytes - ); - } + + struct Hash { + inline size_t operator()(const ZeroCopySource& z) const { + return TfHash::Combine( + reinterpret_cast(z._addr), + z._numBytes + ); + } + }; // Return true if the refcount is nonzero. bool IsInUse() const { return _refCount; } @@ -422,7 +425,7 @@ class CrateFile ArchConstFileMapping _mapping; char const *_start; int64_t _length; - tbb::concurrent_unordered_set _outstandingRanges; + tbb::concurrent_unordered_set _outstandingRanges; }; public: