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

Projects
None yet
2 participants
@john-lynch

john-lynch commented Sep 29, 2015

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 some commits Sep 29, 2015

john-lynch
Fixing move constructor of Final_act to take non-const r-value refere…
…nce and move properly from other Final_act object so that correctness is not dependent on copy elison.
john-lynch
Added test that Final_act object can be moved properly. While this is…
… not a common case, it may happen if the user calls finally and the compiler fails to perform RVO.
@john-lynch

This comment has been minimized.

Show comment
Hide comment
@john-lynch

john-lynch Sep 29, 2015

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.

john-lynch commented Sep 29, 2015

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

This comment has been minimized.

Show comment
Hide comment
@neilmacintosh

neilmacintosh Sep 29, 2015

Collaborator

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

Collaborator

neilmacintosh commented Sep 29, 2015

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

neilmacintosh pushed a commit that referenced this pull request Sep 29, 2015

Neil MacIntosh
Merge pull request #90 from john-lynch/master
Fixing move constructor/semantics of Final_act

@neilmacintosh neilmacintosh merged commit d023ad5 into Microsoft:master Sep 29, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment