forked from lix-project/lix
f4ab297b31
`///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`.
17 lines
234 B
C++
17 lines
234 B
C++
#pragma once
|
|
///@file
|
|
|
|
/**
|
|
* A trivial class to run a function at the end of a scope.
|
|
*/
|
|
template<typename Fn>
|
|
class Finally
|
|
{
|
|
private:
|
|
Fn fun;
|
|
|
|
public:
|
|
Finally(Fn fun) : fun(std::move(fun)) { }
|
|
~Finally() { fun(); }
|
|
};
|