Why declare a deleted assignment operators with the ref-qualifier &
问题 As far as I know a user declared assignment operators differ from built-in operators, as explained by this stackoverflow answer. But why should one add the "&" to a deleted operator? // C++ class MyType { public: // ... MyType& operator=(MyType const&) & = delete; MyType& operator=(MyType &&) & noexcept = default; // more }; I ask because my static code checker reports a rule violation here and I see no reason to add the "&" for a deleted operator. Do I miss something? 回答1: There's no reason