I'm currently learning basics of STL and I came to know that the '()' operator is overloaded. But I don't understand its functionality. I came across this code in which operator overloading is used. So can someone explain me how it works out?
class Node{
public:
int phy,chem,maths;
Node(){
phy = chem = maths = 0;
}
};
class compare{
public:
bool operator()(Node &a,Node &b){
if(a.phy < b.phy) return true;
else if(a.phy > b.phy) return false;
else{
if(a.chem > b.chem) return true;
else if(a.chem < b.chem) return false;
else{
if(a.maths <= b.maths) return true;
else return false;
}
}
}
};