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

inplace_any does not move correctly #207

Open
cschreib opened this issue Mar 23, 2025 · 0 comments · May be fixed by #208
Open

inplace_any does not move correctly #207

cschreib opened this issue Mar 23, 2025 · 0 comments · May be fixed by #208
Labels
bug:confirmed Something isn't working (confirmed)
Milestone

Comments

@cschreib
Copy link
Member

Currently, the implementation of inplace_any implements move semantic by simply copying the storage bits; this works for relocatable types, but doesn't work in general case (one example I have encountered that breaks is std::ofstream). We need to call the type's move constructor to handle this properly in all cases, which means storing not only a deleter, but a "mover".

@cschreib cschreib added the bug:confirmed Something isn't working (confirmed) label Mar 23, 2025
@cschreib cschreib added this to the v1.x milestone Mar 23, 2025
cschreib added a commit that referenced this issue Mar 23, 2025
@cschreib cschreib linked a pull request Mar 23, 2025 that will close this issue
@cschreib cschreib modified the milestones: v1.x, v1.4.0 Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:confirmed Something isn't working (confirmed)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant