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

Fix constraint on unique_ptr<T, D>(auto_ptr<U>&&) #4922

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

CaseyCarter
Copy link
Member

Per suggestion of Howard Hinnant on the LWG reflector. We initialize unique_ptr's stored pointer with the result of calling release() on the auto_ptr. release() has type U*, so the correct constraint is to require U* to be convertible to pointer.

STL will probably laugh himself to tears before rejecting this PR, but it's probably the only chance I'll ever get to fix an auto_ptr-related bug so here it is =)

Per suggestion of Howard Hinnant on the LWG reflector. We initialize `unique_ptr`'s stored `pointer` with the result of calling `release()` on the `auto_ptr`, which returns `U`, so the correct constraint is to require `U*` to be convertible to `pointer`.
@CaseyCarter CaseyCarter added the bug Something isn't working label Aug 30, 2024
@CaseyCarter CaseyCarter requested a review from a team as a code owner August 30, 2024 04:18
@StephanTLavavej
Copy link
Member

Approved with uncontrollable vomiting 🤮 😹

@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 64dc89d into microsoft:main Sep 4, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

🧪 ☣️ ☠️

@CaseyCarter CaseyCarter deleted the auto_ptr branch September 4, 2024 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants