title: Pedantic: What Is A Source File? What Is A Header?
body: <p>For the purposes of this question, I am interested only in Standard-Compliant C++, not C or C++0x, and not any implementation-specific details.</p>
  
  <p><a href="https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename">Questions</a> arise from time to time regarding the difference between <code>#include ""</code> and <code>#include &lt;&gt;</code>.  The argument typically boils down to two differences:</p>
  
  <ol>
  <li>Specific implementations often search different paths for the two forms.  This is platform-specific, and not in the scope of this question.</li>
  <li>The Standard says <code>#include &lt;&gt;</code> is for "headers" whereas <code>#include ""</code> is for a "source file."  Here is the relevant reference:</li>
  </ol>
  
  <blockquote>
  <p><h1>ISO/IEC 14882:2003(E)</h1></p>
  <p><h2>16.2 Source file inclusion [cpp.include]</h2></p>
  <p><b>1</b> A #include directive shall identify a header or source file that can be processed by the implementation.</p>
  <p><b>2</b> A preprocessing directive of the form
  <pre><code># include  &lt h-char-sequence &gt new-line</code></pre>
  searches a sequence of implementation-defined places for a <b>header</b> identified uniquely by the specified sequence between the &lt and &gt delimiters, and causes the replacement of that directive by the entire contents of the header. How the places are specified or the header identified is implementation-defined.</p>
  <p><b>3</b> A preprocessing directive of the form
  <pre><code># include "q-char-sequence" new-line</code></pre>
  causes the replacement of that directive by the entire contents of the <b>source file</b> identified by the specified sequence between the " delimiters. The named source file is searched for in an implementation-defined manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it read
  <pre><code># include  &lt h-char-sequence &gt new-line</code></pre>
  with the identical contained sequence (including > characters, if any) from the original directive.</p>
  </blockquote>
  
  <p>(Emphasis in quote above is mine.) The implication of this difference seems to be that the Standard intends to differentiate between a 'header' and a 'source file', but nowhere does the document define either of these terms or the difference between them.</p>
  
  <p>There are few other places where headers or source files are even mentioned.  A few:</p>
  
  <blockquote>158) A header is not necessarily a source file, nor are the sequences delimited by  in header names necessarily valid source file names (16.2).</blockquote>
  
  <p>Seems to imply a header may not reside in the filesystem, but it doesn't say that source files do, either.</p>
  
  <blockquote><p><h2>2 Lexical conventions [lex]</h2></p>
  <p><b>1</b> The text of the program is kept in units called source files in this International Standard. A source file together with all the headers (17.4.1.2) and source files included (16.2) via the preprocessing directive <code>#include</code>, less any source lines skipped by any of the conditional inclusion (16.1) preprocessing directives, is called a translation unit. [Note: a C + + program need not all be translated at the same time. ]</p></blockquote>
  
  <p>This is the closest I could find to a definition, and it seems to imply that headers are not the "text of the program."  But if you <code>#include</code> a header, doesn't it become part of the text of the program?  This is a bit misleading.</p>
  
  <p>So what is a header?  What is a source file?</p>