I found this code sample for study:
T & T::operator=(T const & x)
{
if (this != &x)
{
this->~T(); // destroy in place
new (this) T(x); // construct in place
}
return *this;
}
When I look at the documentation for new
there is no version that takes a pointer. Thus:
- What does new (this) mean?
- What is it used for?
- How can it be called like this if it is not listed in the documentation?