⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ectorsc.htm

📁 一个非常适合初学者入门的有关c++的文档
💻 HTM
字号:
 Effective C++, 2E | Constructors, Destructors, and Assignment Operators Back to Item 10: Write operator delete if you write operator new.Continue to Item 11: Declare a copy constructor and an assignment operator for classes with dynamically allocated memory.Constructors, Destructors, and Assignment Operators Almost every class you write will have one or more constructors, a destructor, and an assignment operator. Little wonder. These are your bread-and-butter functions, the ones that control the fundamental operations of bringing a new object into existence and making sure it's initialized; getting rid of an object and making sure it's been properly cleaned up; and giving an object a new value. Making mistakes in these functions will lead to far-reaching and distinctly unpleasant repercussions throughout your classes, so it's vital that you get them right. In this section, I offer guidance on putting together the functions that comprise the backbone of well-formed classes. Back to Item 10: Write operator delete if you write operator new.Continue to Item 11: Declare a copy constructor and an assignment operator for classes with dynamically allocated memory. 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -