title: When is it permitted to make the default constructor private
body: <p>I have two classes, one has permitted making the only explicitly declared constructor, the no arguments one, private. I recently added another class but am getting compile-time errors due to having made the no argument constructor private. The only difference is the first had a public static factory method while the latter has a non-static constructor which takes an argument.</p>
  
  <p>Thanks, hope this makes some sense.</p>
  
  <p>Okay, I give you some code:</p>
  
  <p>This doesn't compile:</p>
  
  <pre><code>class GridElem {
  public:
      GridElem(const char _idata);
      ~GridElem();
  private:
      GridElem();
  }
  </code></pre>
  
  <p>This does compile:</p>
  
  <pre><code>class GridElem {
  public:
      GridElem(const char _idata);
      ~GridElem();
      GridElem();
  }
  </code></pre>
  
  <p>This does compile:</p>
  
  <pre><code>class MyClass {
  public:
      ~MyClass();
  private:
      MyClass();
  </code></pre>
  
  <p>Not a complete example, sorry, but I believe this shows where the anomally arises, perhaps from extending <code>cocos2d::Layer</code>?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Alright I found the call that is doing this (eclipse couldn't find it :()</p>
  
  <p>in header</p>
  
  <blockquote>
    <p>GridElem myGrid[15][15];</p>
  </blockquote>
  
  <p>in cpp file</p>
  
  <blockquote>
    <p>MyClass::MyClass() : myGrid{0} {}</p>
  </blockquote>
  
  <p>I only recently changed it from a smaller grid and giving each element explicitly (because it was still just 0 for want of more information), I think this must now expand to parameterless c'tor. I completely forgot that, sorry, but it wasn't 100% obvious mistake.</p>