Running destructor, when constructor throws exception
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/188693/is-the-destructor-called-if-the-constructor-throws-an-exception">Is the destructor called if the constructor throws an exception?</a>  </p>
</blockquote>



<p>I have a question to you. Does destructor is executed, when constructor throws an exception? Sample code:</p>

<pre><code>#include &lt;cstdio&gt;

struct Test
{
    Test (void)
    {
        throw 100;
    }

    ~Test (void)
    {
        printf ("~Test\n");
    }
};

int main (void)
{
    try
    {
        Test test;
    }
    catch (int value)
    {

    }
}
</code></pre>

<p>When running this code "~Test" is not displayed. Ok, I may understand this behavior. Assume that Test have dynamically allocated members, which are allocated inside constructor and deleted in destructor. What will happen with them, when exceptions is thrown after they were allocated in constructor?</p>
