If I have a struct and PQ is there a way for me to sort the heap by more than one variable. So first age, then if those are equal it does height.
Struct Person{
int age;
int height;
int weight;
};
priority_queue<Person, vector<Person>, age_functor>
Struct age_functor{
bool operator() (Person const& one, Person const& two){
return one.age < two.age;
}
}
The code will sort the queue by age but I'm wondering if I can somehow add in a secondary functor.