struct X {
X();
X& operator=(X&);
};
const X cx;
X x;
void f() {
x = cx; // error: X::operator=(X&) cannot assign cx into x
} — end exampleX& X::operator=(const X&)
X& X::operator=(X&)
struct S {
int a;
S& operator=(const S&) = default;
};
struct S {
int a;
S& operator=(const S&) = default;
S& operator=(S&&) = default;
}; — end exampleX& X::operator=(X&&);