Emulate golang's "defer" in C++
pointermath.wordpress.com