C.63: Make move assignment non-virtual, take the parameter by &&, and return by non-const & C.63:保证移动赋值运算符为非虚函数,参数类型为右值引用,返回值为常量引用类型
Reason(原因)
It is simple and efficient.
这样做简单且高效。
See(参见):
The rule for copy-assignment.
拷贝赋值规则。
相关链接:
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rc-copy-assignment
Enforcement(实施建议)
Equivalent to what is done for copy-assignment.
和拷贝赋值的情况时所做的相同。
原文链接
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c63-make-move-assignment-non-virtual-take-the-parameter-by--and-return-by-non-const-
觉得本文有帮助?请分享给更多人。
关注【面向对象思考】轻松学习每一天!
面向对象开发,面向对象思考!