Fix LocalVector<T>::clear when T has no default constructor - #123581
Conversation
Ivorforce
left a comment
There was a problem hiding this comment.
Strange problem to have but I agree this makes sense.
|
First I was like "huh, won't it also fail with resize(0)"? And it will, but I guess this is for the pattern of pushing back initialized values, and clear shouldn't require a default constructor logically. The problem with So I also agree with the PR (even if it's a little strange having to do this). |
Yeah if some operations fail that's fine, the issue is primarily that the local vector destructor uses |
eb006c8 to
777e863
Compare
|
Thanks! |
What problem(s) does this PR solve?
This code did previously not compile:
because
LocalVector::cleardid previously useresizeinternally, it requiredTto have a default constructor.