the comparison function is actually a diff function.  if (diff(*lit, *rit)) return true; reads more naturally to me than if (cmp(*lit, *it)) return true;