title: forward declaration of global friend function
body: <p>I have the following namespaces and classes hierarchy:</p>
  
  <pre><code>namespace Ns1 {
      class Outer {
      private:
             class Inner {
             };
             QSet&lt;Inner&gt; set;
      };
  }
  </code></pre>
  
  <p>Now I need to declare a global functions:</p>
  
  <pre><code>uint qHash(Ns1::Outer::Inner const&amp; el);
  bool operator==(Ns1::Outer::Inner const&amp; el1,
                  Ns1::Outer::Inner const&amp; el);
  </code></pre>
  
  <p>So the function must be a friend to Outer and Inner.
  The problem and to show that the function is in global scope:</p>
  
  <pre><code>friend uint qHash(Ns1::Outer::Inner const&amp; el);
  friend operator==(Ns1::Outer::Inner const&amp; el1,
                  Ns1::Outer::Inner const&amp; el);
  </code></pre>
  
  <p>I can't deal with forward declarations for this case. Any solutions?</p>