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

Use uninitialized_copy to copy into uninitialized memory #465

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

magzot
Copy link
Contributor

@magzot magzot commented Mar 8, 2021

Use uninitialized_copy to prevent from calling copy assignment operator=() on uninitialised memory (unconstructed this).

@magzot
Copy link
Contributor Author

magzot commented Mar 8, 2021

resolves #464

@saudet
Copy link
Member

saudet commented Mar 9, 2021

I see, this essentially allows us to guarantee that the copy constructor always gets called instead of operator=(). Nice catch!

@saudet saudet merged commit 300ac72 into bytedeco:master Mar 10, 2021
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

Successfully merging this pull request may close these issues.

2 participants