title: Overloading a function defined in a namespace
body: <p>Why is the following code illegal?  </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  namespace what {
  void print(int count) {
      cout &lt;&lt; count &lt;&lt; endl;
  }
  }
  
  void what::print(const string&amp; str) {
      cout &lt;&lt; str &lt;&lt; endl;
  }
  
  int main() {
      what::print(1);
      what::print("aa");
  
      return 0;
  }
  </code></pre>
  
  <p>The error I get when compiling with clang and <code>-std=c++14</code> is</p>
  
  <pre><code>error: out-of-line definition of 'print' does not match any declaration in namespace 'what'
  </code></pre>
  
  <p>I know the fix to the problem but I am wondering why the compiler thinks that I am trying to define the function (<code>print</code>) instead of overload it. </p>