6. Explicitly disallow the use of compiler generated functions you do not want
来源:互联网 发布:孕妇枕 知乎 编辑:程序博客网 时间:2024/05/16 15:41
declaring member functions private and deliberately not implementing them
class HomeForSale {public: ...private: ... HomeForSale(const HomeForSale&); HomeForSale& operator=(const HomeForSale&);};
declaring the copy constructor and copy assignment operator private not in HomeForSale itself, but in a base class
class Uncopyable {protected: Uncopyable() {} ~Uncopyable() {}private: Uncopyable(const Uncopyable&); Uncopyable& operator=(const Uncopyable&);};class HomeForSale: private Uncopyable { ...};
Uncopyable is not designed to allow the manipulation of derived class objects via base class interfaces. As a result, they do not need virtual destructor.
阅读全文
0 0
- 6. Explicitly disallow the use of compiler generated functions you do not want
- Item6:Explicitly disallow the use of compiler-generated functions you do not want.
- 【条款6】Explicitly disallow the use of compiler-generated functions you do not want
- Item5: Explicitly disallow the use of compiler-generated functions you do not want--若不想使用编译器自动生成的函数,就该明确拒绝
- 条款06:若不想使用编译器自动生成的函数,就该明确拒绝(Explicitly disallow the use of compiler-generated you do not want.)
- 《Effective C++》读书笔之六 Item 6. Explicitly disallow the use of compile-generated functions
- Do you want the truth?
- The use of functions
- The use of functions
- do you want a piece of me
- 51 You have not configured Oracle Managed Files (OMF) in your database. You do not want to scan the
- DO YOU WANT TO SELL SUGAR WATER OR DO YOU WANT TO CHANGE THE WORLD?
- I want to do that you feel proud of me.
- 小米手机 Do you want to uninstall the existing application?
- 关于“This file has been modified outside of the source editor. Do you want to reload it?”错误的处理
- 关于“This file has been modified outside of the source editor. Do you want to reload it?”错误的处理
- 关于“This file has been modified outside of the source editor. Do you want to reload it?”
- 160 You want to use the automatic management of backup and recovery operations features for your dat
- 视角投影
- js基础
- Maven多模块开发Action:Consider defining a bean of type '*.*.*' in your configuration解决
- 2017-10-25第一篇
- 转:Objective-C 和 Core Foundation 对象相互转换的内存管理总结
- 6. Explicitly disallow the use of compiler generated functions you do not want
- thinkphp5+swoole实现异步邮件群发(SMTP方式)
- SVN插件下载地址及更新地址
- Node.js学习笔记(二)入门指南
- timespec编程报错
- 小米手机 4 Android Studio 调试错误
- Java基础知识总结
- PHP 正则表达式特殊字符 [:alnum:] [:alpha:] 等
- 快讯 | 建筑行业大数据应用前景与趋势论坛成功举办