Help With C++ Sort By Predicate

Correct.

Think of Lamba’s just as a function pointer, you’re just setting that function pointer to the Struct’s () operator. You don’t have to use a struct, I just do if I need to pass parameters that aren’t contained within the array as it’s easier to read IMO and you can reuse that struct in other arrays (assuming they use the same types).