The "stack unwinding", which includes deallocations and whatnot, takes place before the catch block is executed. Maybe this makes it more clear:





#include <iostream>
#include <string>...