Simple utility class for running a cleanup function during stack unwinding. More...
#include <Util/Janitor.H>
Simple utility class for running a cleanup function during stack unwinding.
This is useful in wrapping C APIs where resources are managed with acquisition and release functions. In that case, you can create a Janitor<SomeType> with a pointer to the C release function, so that the release function will be automatically called when the enclosing scope is exited (whether by function return or by exception propagation).
Definition at line 49 of file Janitor.H.