79768031

Date: 2025-09-18 06:11:31
Score: 0.5
Natty:
Report link
class MyClass
{
  bool operator <(const MyClass& rhs) const
  {
    return this->key < rhs.key;
  }
}

Set needs operator< to be const
- For set, the comparator (operator<) must be a const member function because the set needs to compare elements without modifying them.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: avvinci