TMap with struct

I had the same problem and none of the answers here helped me really. I searched a while in the internet but couldn’t get something run for me so I looked in the unreal source code and I found out how I can solve my problem.
I searched for “uint32 GetTypeHash(” and the first header with it was AssetEditorSelectedItem.h from unreal source code. I found out that I had to write a function in my struct with a
uint32 GetTypeHash() const
{
// write your hash generation here
(I found some hash generation in FCrc.h if you need a hash generation)
}
body. Outside the USTUCT I had to implement a function with
FORCEINLINE uint32 GetTypeHash(const ‘structname’& other)
{
return other.GetTypeHash();
}

that’s for the hash, the function with
bool operator==(const ‘structname’& other) const
{
}
worked for me fine.
I know this post is really outdated but I hope my answer can help.

2 Likes