I was wondering if it's safe to write a reset method of some class A by using the move assignment operator on this.
So instead of
A a{};
... // Do something with a
a = A();
if I could write
A a{};
... // Do something with a
a.reset();
where
void A::reset()
{
*this = A();
}
I played arround a bit on godbolt (https://godbolt.org/z/Edc3TT1aT ) and the resulting debug assembly is almost identical with gdb for this example.