Uncaught exception
<p>Why is the exception thrown from <code>getA()</code> not caught?</p>

<pre><code>#include&lt;iostream&gt;
using namespace std;

class Base{

protected:
    int a;
public:
    Base() { a=34; }
    Base(int i){ a = i; }
    virtual ~Base() { if(a&lt;0) throw a; }
    virtual int getA()
    {
        if(a &lt; 0) { throw a;}
    }
};

int main()
{
    try
    {
        Base b(-25);
        cout &lt;&lt; endl &lt;&lt; b.getA();
    }
    catch (int) {
        cout &lt;&lt; endl &lt;&lt; "Illegal initialization";
    }
}
</code></pre>

<h2>EDIT:</h2>

<p>I understand what you are saying about stack unwinding.<br>
If I change <code>Base</code> to the below, I now get my "Illegal initialization" debug to print.  Why am I not getting a call to <code>terminate()</code> any longer?</p>

<pre><code>Base() { a=34; }
Base(int i){ a = i;  if(a&lt;0) throw a;}
virtual ~Base() { if(a&lt;0) throw a; }
virtual int getA()
{
    return a;
}
</code></pre>
