template<class F>
class meshkit::detail::ScopeExit< F >
Scope guard that calls a callable when it is destroyed.
Create it with scopeExit(). The guard is neither copyable nor movable (the deleted copy constructor also suppresses the move constructor) and cannot be dismissed, so the callable runs exactly once, when the guard leaves scope, on normal exit or during stack unwinding. The destructor is implicitly noexcept: an exception escaping the callable calls std::terminate.
- Template Parameters
-
| F | Callable taking no arguments; its result is discarded. |