Skip to content

Commit

Permalink
HashUtils: added std::hash specialization for RefCntAutoPtr
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Jun 26, 2023
1 parent 4ed5850 commit 9ae06e7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Common/interface/HashUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "../../Graphics/GraphicsEngine/interface/PipelineResourceSignature.h"
#include "../../Graphics/GraphicsEngine/interface/PipelineState.h"
#include "../../Graphics/GraphicsTools/interface/VertexPool.h"
#include "../../Common/interface/RefCntAutoPtr.hpp"
#include "Align.hpp"

#define LOG_HASH_CONFLICTS 1
Expand Down Expand Up @@ -1348,6 +1349,16 @@ struct StdHasher
namespace std
{

template <typename T>
struct hash<Diligent::RefCntAutoPtr<T>>
{
size_t operator()(const Diligent::RefCntAutoPtr<T>& Key) const noexcept
{
return std::hash<const T*>{}(static_cast<const T*>(Key));
}
};


template <>
struct hash<Diligent::HashMapStringKey>
{
Expand Down

0 comments on commit 9ae06e7

Please sign in to comment.