There might be an easier way, but the way I’ve done it in the past is create a class that overloads operator(). It would look something like
class Sorter
{
public:
bool operator()(const testStruct& x, const textStruct& y) const;
};
Implement your comparison however you want in that function and just pass in instance of the Sorter class to TArray::Sort.