early-access version 1415

This commit is contained in:
pineappleEA
2021-02-05 02:47:15 +01:00
parent 67cf315423
commit ba262f74d0
8 changed files with 46 additions and 16 deletions

View File

@@ -104,14 +104,6 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
} \
}
/// Evaluates a boolean expression, and returns a result unless that expression is true.
#define R_UNLESS_NOLOG(expr, res) \
{ \
if (!(expr)) { \
return res; \
} \
}
#define R_SUCCEEDED(res) (res.IsSuccess())
/// Evaluates an expression that returns a result, and returns the result if it would fail.

View File

@@ -31,8 +31,6 @@ ScopeExitHelper<Func> ScopeExit(Func&& func) {
}
} // namespace detail
#define SCOPE_GUARD(body) detail::ScopeExit([&]() body)
/**
* This macro allows you to conveniently specify a block of code that will run on scope exit. Handy
* for doing ad-hoc clean-up tasks in a function with multiple returns.
@@ -51,3 +49,9 @@ ScopeExitHelper<Func> ScopeExit(Func&& func) {
* \endcode
*/
#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)