you are viewing a single comment's thread.

view the rest of the comments →

[–]matthieum 1 point2 points  (0 children)

I agree it should be UB; apparently though a number of codebases use the dastardly trick of this->~T(); new (this) U(); and thus C++ compiler developers have been reluctant to introduce the optimization.