23 #ifndef ICL_CORE_AT_SCOPE_END_H_INCLUDED 24 #define ICL_CORE_AT_SCOPE_END_H_INCLUDED 26 #include <boost/function.hpp> bool m_run_at_scope_end
If false, m_func is not run upon destruction.
AtScopeEnd(const boost::function< void()> &func)
Create an object which runs func when it is destroyed.
~AtScopeEnd()
Destructor, calls the function as promised.
void enable()
Enable the object to run the function upon destruction (the default).
boost::function< void()> m_func
The function to run upon destruction.
void disable()
Disable the object, do not run the function upon destruction.