How to sort TArray in c++?

I struggled a bit with this 2 and it only became clear after learning what predicates are.
I also wrote some tutorials/guides on how to work with the data structures for future reference…

There is a section like below you’ll be interested in

" In this example we are passing them in by reference because the TArray::Sort() function REQUIRES your predicate to take in references even if your TArray is made up of pointers.

So TArray<UApples*> will still require a predicate using UApples&…"

3 Likes