Let's stop using true
, and false
and return
the bool
expressions. It make your code so much easier to read.
bool sortClassA (const classA &pt1, const classA &pt2)
{
if(pt2.m_a == pt1.m_a) {
return pt1.m_b > pt2.m_b;
}
return pt1.m_a > pt2.m_a;
};
Also, you created this issue you have with the threshold. Simple lower the threshold to something close to zero and the issue will go away, else you'll have to live with it. I don't see any other way.