title: What's wrong with a header-only C++ application?
body: <p>I'm wondering to code a C++ application with a header-only layout like the following:</p>
  
  <pre><code>// code3.h
  #include &lt;iostream&gt;
  class code3
  {
  public:
    void print()
    {
      std::cout &lt;&lt; "hello " &lt;&lt; std::endl;
    }
  };
  
  // code2.h
  #include "code3.h"
  class code2
  {
  public:
    void print()
    {
      code3 c;
      c.print();
    }
  };
  
  // code1.h
  #include "code3.h"    
  class code1
  {
  public:
    void print()
    {
      code3 c;
      c.print();
    }
  };
  
  // main.cpp
  #include "code1.h"
  #include "code2.h"
  
  int main()
  {
    code1 c1; 
    c1.print();
  
    code2 c2; 
    c2.print();
  }
  </code></pre>
  
  <p>The only cpp file will be the main file. The rest of the code will be placed in header files.</p>
  
  <p>I would like to know if there is some kind of performance problem with this approach. I know that defining the methods in the class declarations inlines them, but as it will be only one cpp file, the inline methods won't be duplicated.
  I just want to focus my question on the performance. I'm not talking about extensibility, legibility, maintenance or anything else. I want to know if I'm missing something with this approach that could  generate a performance problem.</p>
  
  <p>Thanks!</p>