Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.
#pragma once
#include <functional>
/* A trivial class to run a function at the end of a scope. */
class Finally {
private:
std::function<void()> fun;
public:
explicit Finally(std::function<void()> fun) : fun(fun) {}
~Finally() { fun(); }
};