title: c++ class without header
body: <p>Ok, so I don't have a problem, but a question:
  When using c++, you can transfer class to another file and include it without creating header, like this:</p>
  
  <p>foo.cpp :</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class foo
  {
  public:
     string str;
     foo(string inStr)
     {
         str = inStr;
     }
     void print()
     {
        cout&lt;&lt;str&lt;&lt;endl;
     }
  };
  </code></pre>
  
  <p>main.cpp :</p>
  
  <pre><code>#include "foo.cpp"
  using namespace std;
  
  int main()
  {
     foo Foo("That's a string");
     Foo.print();
     return 0;
  }
  </code></pre>
  
  <p>So the question is: is this method any worse than using header files? It's much easier and much more clean, but is it any slower, any more bug-inducing etc?
  I've searched for this topic for a long time now but I haven't seen a single topic on the internet considering this even an option...</p>