-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add scope guard utility #450
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @baothientran, this looks great. Just one nitpick below.
* @brief Upon calling ScopeGuard::Release(), the guard will not execute the | ||
* lambda function when exiting a scope | ||
*/ | ||
void Release() noexcept { _callExitFuncOnDestruct = false; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void Release() noexcept { _callExitFuncOnDestruct = false; } | |
void release() noexcept { _callExitFuncOnDestruct = false; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason to wait another cycle for this. I made this tiny change myself and will merge this momentarily.
fixes #302
Provide ScopeGuard utility to automatically trigger a function upon exiting the scope