![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
GeekBand笔记
bupt_chenjiaxi
这个作者很懒,什么都没留下…
展开
-
C++面向对象高级开发No.2 - Class With Pointer
Item: 先考虑测试用例, 从测试用例考虑函数实现 如果 class with pointer 那么 BigThree 都要自己重新写, 不能用编译器自带的. 拷贝构造函数 copy constructor 析构函数 Destructor 拷贝赋值函数(运算符) copy assignment operator 使用 new( ) 分配原创 2015-08-08 21:21:56 · 681 阅读 · 0 评论 -
C++面向对象高级开发No.1 - Class Without Pointer
Key: Item1: 防卫式声明:避免头文件的重定义 Item2: 构造函数使用 initialization list Item3: 使用 const 限定不需要改变的对象 Item4: 参数传递采用 pass by reference(to const) 而非 pass by value; Item5: return by reference 例外: 永远不要返回 l原创 2015-08-08 21:20:08 · 1250 阅读 · 2 评论