Does the compiler generated assignment operator guard against self assignment?
class T { int x; public: T(int X = 0): x(X) {} }; int main() { T a(
This is an easy one to check empirically:
#include struct A { void operator=(const A& rhs) { if(this==&rhs) std::cout << "Self-assigned\n"; } }; struct B { A a; }; int main() { B b; b = b; }