I have a vector of structs and I want to make it into a heap or priority queue.
I've looked up examples of how this is done with integer arrays using both make_heap() and priority_queue<>, but how does one specify the ordering of a struct? It's no longer a simple matter of throwing in greater<int> or less<int> as the comparator argument.
I suppose I could write my own comparator function, but what's the syntax when calling it in these cases?
Any help/resources would be appreciated.