This might be a stupid question but when overloading an operator for example:
bool operator<(const node & a, const node & b){
return a.value() < b.value();
}
It just compares the values and returns true if a is smaller than b right? Is this a correct way to do it?
edit: before everybody starts being angry: I’m using it to for my priority queue in my A* implemenation where the node with the smaller fscore has the highest priority
edit2: i’ve changed the > to < because it’s better
Yes, and people will hate you for it, because you’re overloading
<but returning>…