Because it is on the stack, it will have its destructor called when it goes out of scope (basically, at the next }, ignoring nested pairs of {... } ). In this case, it goes out of scope when the function it is created in ends. It is created in the function main, so its destructor is called when main ends.