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

Fixing move constructor/semantics of Final_act #90

Merged
merged 3 commits into from
Sep 29, 2015

Conversation

john-lynch
Copy link

The move constructor of Final_act is updated to accept a non-const r-value reference. It also properly moves from the r-value function object member to the function object member of the object being constructed during the move operation. It now has a boolean to indicate whether or not the function object should be invoked in the destructor so that temporary objects that have been moved from do not invoke the function object improperly, removing dependence on copy elision for correct behavior. Finally, a test is added to verify that Final_act objects can be moved, if necessary. This resolves the issues discussed in issue #42.

john-lynch added 3 commits September 28, 2015 23:40
…nce and move properly from other Final_act object so that correctness is not dependent on copy elison.
… not a common case, it may happen if the user calls finally and the compiler fails to perform RVO.
@john-lynch
Copy link
Author

This also resolves issue #11. It handles the move safety aspect of PR #13, which was rejected because the exception safety aspect was not desired.

@neilmacintosh
Copy link
Collaborator

This looks good to me. Thanks for the PR John!

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.

None yet

2 participants