How to enforce that classes's instances only be allocated on the stack, but not on the heap
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/124856/how-do-i-prevent-a-class-from-being-allocated-via-the-new-operator-id-like-t">How do I prevent a class from being allocated via the &#39;new&#39; operator? (I&#39;d like to ensure my RAII class is always allocated on the stack.)</a>  </p>
</blockquote>



<p>For C++, how to enforce that classes's instances only be allocated 
on the stack, but not on the heap, at compile-time?</p>

<p>I think all data members and functions are allocated in stack unless
they are declared by new operator. </p>

<p>right ? </p>

<p>Any help is really appreciated. </p>
