Create a scope guard in the dismissed state.
Declared in <folly/ScopeGuard.h>
template<typename F>
[[nodiscard]]
/* implementation-defined */
makeDismissedGuard(F&& f) noexcept(/* see-below */);
The guard can be enabled using .rehire().
This function is potentially-throwing unless noexcept(detail::ScopeGuardImplDecay<F, true>(static_cast<F &&>(f), detail::ScopeGuardDismissed{})).
A dismissed scope guard that runs f only after being rehired.
The return value should not be discarded.
| Name | Description |
|---|---|
| f | The function to execute upon the guard's destruction. |
makeGuard refcode folly/docs/examples/folly/ScopeGuard2.cpp