title: Ordering of using namespace std; and includes?
body: <p>I recently saw this code being used in a source file in a C++ project:</p>
  
  <pre><code>using namespace std;
  #include &lt;iostream&gt;
  </code></pre>
  
  <p>Ignoring all issues of whether it's a good idea to have <code>using namespace std</code> at all, is the above code even legal?  There is no code in the file before these two lines.</p>
  
  <p>I would have thought that this wouldn't compile, since <code>namespace std</code> hasn't been declared in scope until the <code>#include &lt;iostream&gt;</code> directive includes it into the file, but using the build system for the project this was compiling just fine.  If someone has a link to a relevant part of the spec, that would be most appreciated.  </p>