Using custom C++ structs as TMap keys in Unreal Engine

Published October 15, 2020 Imported
Advertisement

Let’s take a look at how to equip custom structs with comparison and hashing capabilities.

Read more

0 likes 2 comments

Comments

MagForceSeven

Yeah, it's a really great thing to support for types like custom Handles or IDs.

One nitpick, your ‘FORCEINLINE’ won't do any good in any build unless the full function definition is in the header. There's also really no reason to do it only in SHIPPING. You might as well just have it there in all builds and move the function to exist purely in the header.
Or remove the ‘FORCEINLINE’ completely and leave the definition in the cpp.

October 15, 2020 02:59 PM
blurryroots

@MagForceSeven Ahoi there, thanks for commenting. You're right. My intention was to add better debug support. Guess it would make sense to flip the logic, and exclusivly not inline, when the build profile is set to debug. Fixed! ?

October 15, 2020 03:08 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement