Skip to content

Implement LWG-3548 shared_ptr construction from unique_ptr should move (not copy) the deleter - #2007

Merged
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:mainfrom
AdamBucior:lwg3548
Jun 29, 2021
Merged

Conversation

@AdamBucior

Copy link
Copy Markdown
Contributor

No description provided.

@AdamBucior
Adam Bucior (AdamBucior) requested a review from a team as a code owner June 13, 2021 12:05
@StephanTLavavej Stephan T. Lavavej (StephanTLavavej) added the LWG Library Working Group issue label Jun 14, 2021
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks! I agree that forward is appropriate outside of a perfect forwarding context here (this also occurs in pair and tuple when a type might be a reference).

I found a convenient place to add test coverage - we had a fancy-pointer deleter that was being used to construct a unique_ptr that was then moved into a shared_ptr with no other usage, so we can make that deleter movable-only and ensure that this behavior is never damaged by future maintenance.

@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for improving everyone's favorite smart pointers! 🧠 😸

@AdamBucior
Adam Bucior (AdamBucior) deleted the lwg3548 branch June 29, 2021 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LWG Library Working Group issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants