title: How to prevent an object being created on the heap?
body: <p>Does anyone know how I can, in platform-independent C++ code prevent an object from being created on the heap? That is, for a class "Foo", I want to prevent users from doing this:</p>
  
  <pre><code>Foo *ptr = new Foo;
  </code></pre>
  
  <p>and only allow them to do this:</p>
  
  <pre><code>Foo myfooObject;
  </code></pre>
  
  <p>Does anyone have any ideas?</p>
  
  <p>Cheers,</p>