title: C++ “invalid comparator” error in operator overload when negating the result
body: <p>I ran into very strange problem regarding operator overload. The function below works fine outside the if branch. When I attempt to negate the result of comparison I always get “invalid comparator” error.
  Negating using ! does not work, same with ternary operator. Why is this happening? </p>
  
  <pre><code>bool operator&lt;(const Team&amp; firstTeam, const Team&amp; secondTeam)
  {
   if (firstTeam.getId() &gt; 8) {
    return !( firstTeam.getId() &lt; secondTeam.getId());
   }
   return firstTeam.getId() &lt; secondTeam.getId();
  }
  </code></pre>