I believe you are talking about
*ptr = T(std::forward<Args>(args)...)
That's an rvalue ref so std::move is superfluous. Not an assign
*ptr = T(std::forward<Args>(args)...)
That's an rvalue ref so std::move is superfluous. Not an assign
new (ptr) T; // default-initialization of T
*ptr = T(std::forward<Args>(args)...); // Constructs a new T, then calls operator=(T&&) on ptr, then destroys the T that got moved
I meant he should do the placement new like this: new (ptr) T(std::forward<Args>(args)...) // Constructs directly on ptr
See https://godbolt.org/z/9nT94zxoE