title: How to explicitely call friend stream operator?
body: <p>Considering this snippet, as expected gcc cannot find which symbol to choose between NA::operator&lt;&lt; and NB::operator&lt;&lt; when calling stream operator without specifying namespace (by calling stream operator like 1)). It is possible to call NB::operator&lt;&lt; explicitely (like 2). This runs and have the expected behaviour. But a build error is raised when trying to do the same with friend stream operator (like 3), telling that operator&lt;&lt; is not a member of NA. Why?
  NA::operator&lt;&lt; seems to be found in case 1)...</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  #include &lt;fstream&gt;
  
  namespace NA {
      class A {
          friend inline std::ostream &amp; operator&lt;&lt;(std::ostream &amp; s, const A &amp; object) {
              std::cout &lt;&lt; "NA::operator&lt;&lt;" &lt;&lt; std::endl;
              return s;
          }
      };
  }
  
  namespace NB {
      std::ostream &amp; operator&lt;&lt;(std::ostream &amp; s, const NA::A &amp; object) {
          std::cout &lt;&lt; "NB::operator&lt;&lt;" &lt;&lt; std::endl;
          return s;
      }
      void func(const NA::A* a);
  }
  
  void NB::func(const NA::A* a) {
      std::ofstream ofs;
      //1)
      //ofs &lt;&lt; *a; //build error:
      //error: ambiguous overload for 'operator&lt;&lt;' (operand types are 'std::ofstream' {aka 'std::basic_ofstream&lt;char&gt;'} and 'const NA::A')
      //2)
      //NB::operator&lt;&lt;(ofs, *a); //runs and displays NB::operator&lt;&lt;
      //3)
      NA::operator&lt;&lt;(ofs, *a); //build error:
      //error: 'operator&lt;&lt;' is not a member of 'NA'
  }
  
  int main()
  {
      NA::A obj_a;
      NB::func(&amp;obj_a);
  }
  </code></pre>
  
  <p>My question is, how to explicitely call NA::operator&lt;&lt; ?</p>