C++ Rule of Three

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C++ Rule of Three相关的知识,希望对你有一定的参考价值。

Rule of Three

The rule of three (also known as the Law of The Big Three or The Big Three) is a rule of thumb in C++ (prior to C++11) that claims that if a class defines one (or more) of the following it should probably explicitly define all three:[1] 

如果需要析构函数,则一定需要拷贝构造函数和赋值操作符

以上是关于C++ Rule of Three的主要内容,如果未能解决你的问题,请参考以下文章

现代C++应用之Rule of Zero

CRM SFA Determine the Type of Claim Rule Template to Use

[译]API设计的黄金法则(The Golden Rule of API Design)

为啥 rewrite_rule 仅在文件夹存在时才有效?

The most important rules of writing paper

C++ 矩阵乘法向量 out_of_range 异常