Let’s take a look at how to equip custom structs with comparison and hashing capabilities.
Using custom C++ structs as TMap keys in Unreal Engine
posted in Think BIQ - Remembering the future
Imported
Previous Entry
Custom shader code in Unreal Engine — Part 2: Modularization
Comments
October 15, 2020 02:59 PM
@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
Advertisement
Latest Entries
Advertisement
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.