13 #ifndef MAGICSMOKE_LAMBDACLEAN_H
14 #define MAGICSMOKE_LAMBDACLEAN_H
18 #ifndef MSIFACE_EXPORT
19 #define MSIFACE_EXPORT Q_DECL_IMPORT
25 std::function<void()>m_ptr;
28 MCleanup(
const std::function<
void()>&f):m_ptr(f){}
void setFunction(const std::function< void()> &f)
sets a new cleanup function, removing the old one
Definition: cleanup.h:31
~MCleanup()
destructs the object and executes the cleanup function
Definition: cleanup.h:34
#define MSIFACE_EXPORT
Definition: cleanup.h:19
clean-up function: executes a lambda expression when it is destructed (i.e. when the instance leaves ...
Definition: cleanup.h:23
MCleanup(const std::function< void()> &f)
instantiates a new cleanup object and remembers the given function for later execution ...
Definition: cleanup.h:28