title: Namespace Aliasing in C++
body: <p>It is widely known that adding declarations/definitions to <code>namespace std</code> results in undefined behavior. The only exception to this rule is for template specializations.</p>
  
  <p>What about the following "hack"?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  namespace std_
  {
    void Foo()
    {
      std::clog &lt;&lt; "Hello World!" &lt;&lt; std::endl;
    }
  
    using namespace std;
  }
  
  int main()
  {
    namespace std = std_;
  
    std::Foo();
  }
  </code></pre>
  
  <p>Is this really well-defined as far as the standard is concerned? In this case, I'm really not adding anything to <code>namespace std</code>, of course. Every compiler I've tested this on seems to happily swallow this.</p>
  
  <hr>
  
  <p>Before someone makes a comment resembling "why would you ever do that?" -- this is just to satisfy my curiosity...</p>