title: Prevent instantiation of an object outside its factory method
body: <p>Suppose I have a class with a factory method</p>
  
  <pre><code>class A {
  public:
    static A* newA()
    {
      // Some code, logging, ...
      return new A();
    }
  }
  </code></pre>
  
  <p>Is it possible to prevent the instantiation of an object of this class with a <code>new</code>, so that factory method is the only method to create an instance of the object?  </p>