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的主要内容,如果未能解决你的问题,请参考以下文章