mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-15 15:32:58 +00:00
common: scope_exit: Add a cancellable ScopeExit macro.
This commit is contained in:
parent
ff3c7c068b
commit
18175c71ed
|
@ -49,3 +49,9 @@ ScopeExitHelper<Func> ScopeExit(Func&& func) {
|
||||||
* \endcode
|
* \endcode
|
||||||
*/
|
*/
|
||||||
#define SCOPE_EXIT(body) auto CONCAT2(scope_exit_helper_, __LINE__) = detail::ScopeExit([&]() body)
|
#define SCOPE_EXIT(body) auto CONCAT2(scope_exit_helper_, __LINE__) = detail::ScopeExit([&]() body)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This macro is similar to SCOPE_EXIT, except the object is caller managed. This is intended to be
|
||||||
|
* used when the caller might want to cancel the ScopeExit.
|
||||||
|
*/
|
||||||
|
#define SCOPE_GUARD(body) detail::ScopeExit([&]() body)
|
||||||
|
|
Loading…
Reference in a new issue