Skip to content
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

Scopeguard advice. #24

Closed
wants to merge 1 commit into from
Closed

Scopeguard advice. #24

wants to merge 1 commit into from

Conversation

dabrahams
Copy link
Contributor

No description provided.

under mutation may exposed outside the class other than by
returning, e.g. if it is passed to a callback function.

2. If your function reports errors to the caller other than by
Copy link
Member

@sean-parent sean-parent Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is not true - scope_success only checks on non-exception exit (hense "success"). You might want a caveat that this does not check the invariant in case of an exception (and why) - and scope_exit can be used if the check should be done even in case of an exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You missed the words "other than." I'm talking about functions that e.g. return error codes.

Copy link
Member

@sean-parent sean-parent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment.

@dabrahams
Copy link
Contributor Author

Closing as obsolete

@dabrahams dabrahams closed this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants