title: Application crashes when exception is thrown from constructor
body: <p>When an exception is thrown from the class constructor, the program crashes. While running in debug mode I get the following error "Unhandled exception at 0x74A2DB18 in VirtualCtor.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000." It crashes in release mode too. I understand that this because throw does not find the exact catch handler and std::terminate() is called. But, I had the understanding that catch(...) should handle this. Can someone let me know the exact handler that I need to use with catch? </p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;exception&gt;
  using namespace std;
  
  class MyClass
  {
   public: 
        MyClass() { cout &lt;&lt; "Default Ctor" &lt;&lt; endl;
        throw; //runtime exception.
  }
   ~MyClass()
   {
      cout &lt;&lt; "Destructor called" &lt;&lt; endl;
   }
  };
  
  int main()
  {
    MyClass*vpt = nullptr;
    try {
          vpt = new MyClass;
     }
    catch (...) {
          delete vpt;
          cout &lt;&lt; "Exception"&lt;&lt; endl;
      }
  
    return    0;
   }
  </code></pre>
  
  <p>Changing code throw bad_alloc(); catches the exception and the code crashes no longer, but I need to understand what happens with just calling throw from function/constructor?</p>
  
  <p>Thanks.</p>