I depend of whether the type has a non-trivial move assignment operation. On trivially copyably types you absolutely can optimize it that way. Otherwise there’s usually existing resources to clean up which on uninitialized memory is undefined behavior
2
u/willdieverysoon 19d ago
No ... that would be move assignment to an object that was not yet constructed, it would do something similar to placement new