title: Why can overloaded operators not be defined as static members of a class?
body: <p>C++ syntax allows defining overloaded operators either inside the struct/class like:</p>
  <pre><code>struct X
  {
     void operator+(X);
  }
  </code></pre>
  <p>or outside of the struct/class like:</p>
  <pre><code>void operator+(X, X);
  </code></pre>
  <p>but not as:</p>
  <pre><code>struct X
  {
     static void operator+(X, X);
  }
  </code></pre>
  <p>Does anybody know reasons for this decision? Why is the third form not allowed? (MSVC gives a syntax error.) Maybe there is some story behind this?</p>
  <p>P.S. The presence of the first and second definitions at the same time creates ambiguity:</p>
  <pre><code>1&gt;CppTest1.cxx
  1&gt;c:\ballerup\misc\cf_html\cpptest1.cxx(39) : error C2593: 'operator +' is ambiguous
  1&gt;        c:\ballerup\misc\cf_html\cpptest1.cxx(13): could be 'void B1::operator +(B1 &amp;)'
  1&gt;        c:\ballerup\misc\cf_html\cpptest1.cxx(16): or       'void operator +(B1 &amp;,B1 &amp;)'
  1&gt;        while trying to match the argument list '(B1, B1)'
  </code></pre>
  <p>I do not understand why this ambiguity is any better than between 1,3 or 2,3.</p>