1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-18 21:55:45 +02:00
bees/include/crucible/cleanup.h
Zygo Blaxell a3cd3ca07f crucible: add cleanup class
Store a function (or closure) in an instance and invoke the function
from the destructor.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
2017-10-01 16:18:47 -04:00

19 lines
263 B
C++

#ifndef CRUCIBLE_CLEANER_H
#define CRUCIBLE_CLEANER_H
#include <functional>
namespace crucible {
using namespace std;
class Cleanup {
function<void()> m_cleaner;
public:
Cleanup(function<void()> func);
~Cleanup();
};
}
#endif // CRUCIBLE_CLEANER_H