TMap access elements by index
I'm using a map to count votes for a voting system, so the vote string is the key, and the vote count is the value.
I sort the map to get the top vote, but now how do I access the top vote? A hack way of doing it I came up with was doing a for loop and breaking on the first iteration.
But what if there's a tie? I need to check if the second element and first element have the same count?
I need to be able to access elements in ordered indices. Can I do that? Or is there something else that can help me?
asked Aug 26 '15 at 07:52 AM in C++ Programming
Convert keys/values to an array and you will be able to access them with index. https://docs.unrealengine.com/latest/CHN/Programming/UnrealArchitecture/TMap/index.html
GenerateKeyArray and GenerateValueArray keywords.
Follow this question
Once you sign in you will be able to subscribe for any updates here