title: C++ Cannot call constructor directly in small example
body: <p>I was wondering, why I cannot call a constructor. Even this small example fails to compile with the message: </p>
  
  <pre><code>Klassentest.cpp:24:27: error: cannot call constructor 'Sampleclass::Sampleclass' directly [-fpermissive]
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class Sampleclass
  {
     public:
      Sampleclass();
  };
  
  Sampleclass::Sampleclass(){
  
  }
  
  int main() {
      cout &lt;&lt; "!!!Hello World!!!" &lt;&lt; endl; // prints !!!Hello World!!!
      Sampleclass::Sampleclass() *qs = new Sampleclass::Sampleclass();
      return 0;
  }
  </code></pre>
  
  <p>I used the Cygwin g++ compiler in version 4.9.3-1.</p>
  
  <p>Thank you for your help.</p>