You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
The text was updated successfully, but these errors were encountered:
All of
unique_ptr::operator=(unique_ptr&&)
,shared_ptr(shared_ptr&&)
, andshared_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 addingu.get()==nullptr
to those two sets of postconditions, we might be able to remove the whole definition of "transfer ownership".The text was updated successfully, but these errors were encountered: