A few questions on SO use a particular syntax for declaring default assignment operators.
Rule-of-Three becomes Rule-of-Five with C++11?
class C {
C(const C&) = default;
C(C&&) = default;
C& operator=(const C&) & = default;
C& operator=(C&&) & = default;
virtual ~C() { }
};
I'm confused by the & = used for the assignment operators. After a quick test, default assignment operator declarations seem to compile and give the expected behavior with or without the additional ampersand.
I don't see the & = syntax on cppreference.