-
Notifications
You must be signed in to change notification settings - Fork 1.6k
<vector>: prevent move ctor initializes members twice #1330
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
Conversation
b133b34 to
26fdeab
Compare
StephanTLavavej
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
unique_ptr still calls reset(pointer()) to select a specific overload.
|
I pushed a fix for the test failure that I caused by getting greedy with the
With this, the test should pass, and I believe it meets the requirements now. |
Value-init of this class previously resulted in zero-initialization since the default constructor was not user-provided. (I don't know if there's a name for this "trivial default-init but deterministic value-init" idiom.)
Implicit construction, yes, and the most common failure is trying to assign convertible to convertible to X, violating the "at most one user-defined conversion" rule. |
Ah, you are indeed correct. I updated my description accordingly, thanks. (Yay, the code was only broken in N - 1 ways.) |
|
Thanks for improving |
Fixes #1324