I\'ve written a small utility class for C++11 which I use as a scope guard for easier handling of exception safety and similar things.
Seems somewhat like a hack. Bu
But is it a good idea?
Sure. A related topic is the RAII paradigm.
Or are there potential problems I have missed?
You don't handle exceptions.
Is there already a similar solution (with C++0x features) in boost or similar?
Alexandrescu came up with ScopeGuard a long time back. Both Boost and std::tr1 has a thing called scoped_ptr and shared_ptr (with a custom deleter) that allows you to accomplish just this.