C.22: Make default operations consistent
C.22: 保持默认操作的一贯性
Reason(原因)
The default operations are conceptually a matched set. Their semantics are interrelated. Users will be surprised if copy/move construction and copy/move assignment do logically different things. Users will be surprised if constructors and destructors do not provide a consistent view of resource management. Users will be surprised if copy and move don't reflect the way constructors and destructors work.默认操作从概念上讲是配合严密的一整套处理。它们的语义是相互关联的。如果拷贝/移动构造和拷贝/移动赋值做的是逻辑上不同的事情,用户会感到诧异;如果构造函数和析构函数没有为资源管理提供一致的想法,用户会感到诧异;如果拷贝和移动操作没有对应构造函数和析构函数的动作,用户会感到诧异。
Example, bad(反面示例)