title: How do I declare a namespace alias in a header file, then use it in a source file?
body: <p>I want to put a namespace alias (ie namespace A = B::C) in a header file so I can use it in source files, but the compiler just tells me that its "not a namespace name". Any thoughts?</p>
  
  <p>This is a very simplified axample of what I'm trying to do...</p>
  
  <p>header file:</p>
  
  <pre><code>namespace A{
  namespace B{
  int getInt();
  }
  }
  
  namespace AB = A::B;
  
  source file:
  
  #include "header_file.h"
  #include &lt;iostream&gt;
  
  int AB::getInt(){ // Error "AB is not a namespace name"
  return 123;
  }
  </code></pre>