#include <iostream>
class A
{
int m_n;
public:
A(int n) : m_n(n)
{ }
~A() { std::cout << "~A" << m_n << std::endl; }
A& operator = (A&& a)
{
int temp = m_n;
m_n = a.m_n;
a.m_n = temp;
return *this;
}
};
int main()
{
A a(1);
a = A(2);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKY2xhc3MgQQp7CiAgaW50IG1fbjsKcHVibGljOgogIEEoaW50IG4pIDogbV9uKG4pCiAgeyB9CiAgfkEoKSB7IHN0ZDo6Y291dCA8PCAifkEiIDw8IG1fbiA8PCBzdGQ6OmVuZGw7IH0KIAogIEEmIG9wZXJhdG9yID0gKEEmJiBhKQogIHsKICAgIGludCB0ZW1wID0gbV9uOwoJbV9uID0gYS5tX247CglhLm1fbiA9IHRlbXA7CiAgICByZXR1cm4gKnRoaXM7CiAgfQp9OwoKaW50IG1haW4oKQp7CiAgIEEgYSgxKTsKICAgYSA9IEEoMik7Cn0K