If a class C has a copy constructor, seems desirable to generate a default copy assign like:
C & operator = (C const &rhs)
{
if (this != &rhs)
{
this->~C();
::new (this) C(rhs);
}
return *this;
}
Likewise for default move assign when move copy is defined:
C & operator = (C &&rhs)
{
if (this != &rhs)
{
this->~C();
::new (this) C(std::move(rhs));
}
return *this;
}
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals