C++ Bashing

I did this talk at the CCC camp 2007.

As you can see, C++ is really complex, and so a few mistakes crept in. First of all, exceptions in constructors do call local destructors, but only if the exception is caught. I did not catch it when I tested this, and in that case the runtime just calls terminate , which immediately terminates the process without cleaning anything up. I should have tried that but did not and just assumed the other case is handled in the same way. Here is my test program, and here is one that shows it works if you catch the exception.

Also, I botched the constructor and vtable of base class slide. The issue is more complex than that. This C++ source code illustrates the issue. It was taken from this nice list of C++ pitfalls.

Thanks to Immanuel Scholz for pointing these out.