How to hide "delete" on a class hierarchy?
<p>So I am migrating from an "owned" object model to a "managed" object model in a project I am doing.  Currently to make a new Thing one does </p>

<pre><code>Thing *thing = new Thing();
</code></pre>

<p>and to get rid of it and destroy it the owner does</p>

<pre><code>delete thing
</code></pre>

<p>Now there are a lot of "delete thing"s out there and many of them are deleting from a 
superclass of Thing pointer because the superclass has a virtual destructor.</p>

<p>Now in the managed model there is a base class with a virtual destructor which the manager will delete.  The user is supposed to call "release" on it <em>NOT</em> delete.</p>

<p>So I would like to somehow at compile time reject "delete thing" as a compile time error.
Making the destructor "protected" doesn't seem to work because of the virtual destructor on the base. And it needs to be at least protected for subclasses (I think).</p>

<p>Anyone have any ideas?</p>
