title: difference between global operator and member operator
body: <p>Is there a difference between defining a global operator that takes two references for a class and defining a member operator that takes only the right operand?</p>
  
  <p>Global:</p>
  
  <pre><code>class X
  {
  public:
      int value;
  };
  
  bool operator==(X&amp; left, X&amp; right) 
  {
      return left.value == right.value;
  };
  </code></pre>
  
  <p>Member:</p>
  
  <pre><code>class X
  {
      int value;
      bool operator==( X&amp; right) 
      {
          return value == right.value;
      };
  }
  </code></pre>