early-access version 1410
This commit is contained in:
@@ -104,6 +104,14 @@ __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.
|
||||
|
@@ -31,6 +31,8 @@ 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.
|
||||
|
Reference in New Issue
Block a user