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

[unique.ptr] Consider removing "transfer ownership" definition #1643

Closed
jyasskin opened this issue Jun 14, 2017 · 0 comments
Closed

[unique.ptr] Consider removing "transfer ownership" definition #1643

jyasskin opened this issue Jun 14, 2017 · 0 comments
Assignees

Comments

@jyasskin
Copy link
Contributor

All of unique_ptr::operator=(unique_ptr&&), shared_ptr(shared_ptr&&), and shared_ptr::operator=(shared_ptr&&) explicitly leave their source with .get()==nullptr. unique_ptr(unique_ptr&&)'s wording delegates that to the "transfer ownership" definition in [unique.ptr], without explicitly referring to the section of the definition, which caused me to miss that it was defined at all.

As far as I can see, that term is only used twice in the standard, for the unique_ptr move constructor and templated move constructor, and I believe its other 2 bullets are repeated by the existing postconditions for those operations. By adding u.get()==nullptr to those two sets of postconditions, we might be able to remove the whole definition of "transfer ownership".

@jensmaurer jensmaurer self-assigned this Nov 15, 2017
@jensmaurer jensmaurer changed the title Consider removing "transfer ownership" definition [unique.ptr.single.asgn] Consider removing "transfer ownership" definition Nov 15, 2017
@jensmaurer jensmaurer changed the title [unique.ptr.single.asgn] Consider removing "transfer ownership" definition [unique.ptr] Consider removing "transfer ownership" definition Nov 15, 2017
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

No branches or pull requests

2 participants