<vector>: prevent move ctor initializes members twice#1330
<vector>: prevent move ctor initializes members twice#1330StephanTLavavej merged 5 commits intomicrosoft:masterfrom
Conversation
b133b34 to
26fdeab
Compare
StephanTLavavej
left a comment
There was a problem hiding this comment.
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