15 bool movedFrom =
false;
18 Finally(Fn fun) : fun(std::move(fun)) { }
21 Finally(Finally &other) =
delete;
22 Finally(Finally &&other) : fun(std::move(other.fun)) {
23 other.movedFrom =
true;
26 ~Finally()
noexcept(
noexcept(fun()))
38 if (std::uncaught_exceptions()) {
40 "Finally function threw an exception during exception handling. "
41 "this is not what you want, please use some other methods (like "
42 "std::promise or async) instead.");