#include <iostream>
using namespace std;
#include <iostream>
class MyClass {
public:
MyClass() { std::cout << "Default constructor called" << std::endl; }
MyClass(const MyClass& other) { std::cout << "Copy constructor called" << std::endl; }
MyClass(MyClass&& other) { std::cout << "Move constructor called" << std::endl; }
MyClass& operator=(const MyClass& other) {
std::cout << "Copy assignment operator called" << std::endl;
return *this;
}
MyClass& operator=(MyClass&& other) {
std::cout << "Move assignment operator called" << std::endl;
return *this;
}
};
int main() {
MyClass a;
MyClass& a_ref = a;
MyClass b;
a_ref = b;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCiNpbmNsdWRlIDxpb3N0cmVhbT4KCmNsYXNzIE15Q2xhc3MgewpwdWJsaWM6CiAgICBNeUNsYXNzKCkgeyBzdGQ6OmNvdXQgPDwgIkRlZmF1bHQgY29uc3RydWN0b3IgY2FsbGVkIiA8PCBzdGQ6OmVuZGw7IH0KICAgIE15Q2xhc3MoY29uc3QgTXlDbGFzcyYgb3RoZXIpIHsgc3RkOjpjb3V0IDw8ICJDb3B5IGNvbnN0cnVjdG9yIGNhbGxlZCIgPDwgc3RkOjplbmRsOyB9CiAgICBNeUNsYXNzKE15Q2xhc3MmJiBvdGhlcikgeyBzdGQ6OmNvdXQgPDwgIk1vdmUgY29uc3RydWN0b3IgY2FsbGVkIiA8PCBzdGQ6OmVuZGw7IH0KCiAgICBNeUNsYXNzJiBvcGVyYXRvcj0oY29uc3QgTXlDbGFzcyYgb3RoZXIpIHsKICAgICAgICBzdGQ6OmNvdXQgPDwgIkNvcHkgYXNzaWdubWVudCBvcGVyYXRvciBjYWxsZWQiIDw8IHN0ZDo6ZW5kbDsKICAgICAgICByZXR1cm4gKnRoaXM7CiAgICB9CgogICAgTXlDbGFzcyYgb3BlcmF0b3I9KE15Q2xhc3MmJiBvdGhlcikgewogICAgICAgIHN0ZDo6Y291dCA8PCAiTW92ZSBhc3NpZ25tZW50IG9wZXJhdG9yIGNhbGxlZCIgPDwgc3RkOjplbmRsOwogICAgICAgIHJldHVybiAqdGhpczsKICAgIH0KfTsKCgoKaW50IG1haW4oKSB7CglNeUNsYXNzIGE7CglNeUNsYXNzJiBhX3JlZiA9IGE7CglNeUNsYXNzIGI7CglhX3JlZiA9IGI7CglyZXR1cm4gMDsKfQ==