17 JPH_INLINE
explicit ScopeExit(F &&inFunction) : mFunction(
std::move(inFunction)) { }
40 bool mInvoked =
false;
43#define JPH_SCOPE_EXIT_TAG2(line) scope_exit##line
44#define JPH_SCOPE_EXIT_TAG(line) JPH_SCOPE_EXIT_TAG2(line)
47#define JPH_SCOPE_EXIT(...) ScopeExit JPH_SCOPE_EXIT_TAG(__LINE__)(__VA_ARGS__)
#define JPH_NAMESPACE_END
Definition Core.h:379
#define JPH_NAMESPACE_BEGIN
Definition Core.h:373
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
Class that calls a function when it goes out of scope.
Definition ScopeExit.h:14
JPH_INLINE ~ScopeExit()
Destructor calls the exit function.
Definition ScopeExit.h:20
JPH_INLINE void Release()
No longer call the exit function when going out of scope.
Definition ScopeExit.h:33
JPH_INLINE void Invoke()
Call the exit function now instead of when going out of scope.
Definition ScopeExit.h:23
JPH_INLINE ScopeExit(F &&inFunction)
Constructor specifies the exit function.
Definition ScopeExit.h:17