Calling child method from parent destructor in C++
<pre><code>class A {
public:
  ~A() { release(); }
  virtual release() { cout &lt;&lt; "~A"; } 
}

class B : public A {
  release() { cout &lt;&lt; "~B"; }
}
</code></pre>

<p>When I delete B, only A class release() method is called.</p>

<p>What I want to achieve is for every child object, when it is deleted, I want to call release method which is overriden in each child class, without manually specifying destructor for each child with call to release (I'm lazy). Is this actually not possible to achieve in this or any other way?</p>
