Files
UnrealEngineUWP/Engine/Source/Runtime/Core/Private/Containers
kevin macaulayvacher ecde69237e Adds missing GetId() member from TSet::TBaseKeyIterator.
Without this implementation, it's not possible to use GetId() on TMap::TKeyIterators/TConstKeyIterators

This missing implementation is specifically helpful for cases where you'd like to find the KV Pair ElementType for a given KeyArgumentType in cases where you may have collisions between keys and the actual KeyArgumentType value is important.

Example case is when dealing with FNames in Editor since they compare on case-insensitive CompareIds but have unique DisplayIds for different casing. If you want to know the casing used when inserted into a map, you can now do the following:

TMap<FName, FAssetPackageData*>::TConstKeyIterator It = CachedPackageData.CreateConstKeyIterator(PackageFNameOfAnyCase);
FSetElementId Id = It.GetId();
if (!Id.IsValidId())
{
    return nullptr;
}

const TPair<FName, FAssetPackageData*> KVPair = CachedPackageData.Get(Id);
FName PackageNameWithCasingUsedUponInsertion = KVPair.Key;

return KVPair.Value;
#rb Francis.Hurteau, Steve.Robb

[CL 30969014 by kevin macaulayvacher in ue5-main branch]
2024-01-29 10:19:41 -05:00
..
2024-01-17 01:34:02 -05:00