《Effective C++ 2nd Edition》读书笔记

本文是《Effective C++ 2nd Edition》的读书笔记,涵盖改变旧有C习惯、内存管理、构造析构函数等多方面内容。如尽量用const和inline取代#define,用<iostream>取代<stdio.h>,还提醒要清楚编译器默认完成和调用的函数,重视编译器警告。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

《Effective C++ 2nd Edition》读书笔记
 Section 1: 改变旧有的C习惯( Shifting from C to C++ ) 
      Item 1: 尽量以 const 和 inline 取代 #define
           Perfer const and inline to #define.
      Item 2: 尽量以 <iostream> 取代 <stdio.h>
           Perfer <iostream> to <stdio.h>.
      Item 4: 尽量使用C++风格的注释形式
           Perfer C++ style comments.
 Section 2: 内存管理 ( Memory Management )
 Section 3: 构造函数、析构函数和 Assignment 运算符
            ( Constructor, Destructor and Assignment Operators )
 Section 4: 类与函数之设计与声明
            ( Classes and Functions: Design and Declaration )
      Item 27: 如果不想使用编译器暗自产生的 member function,就应该明白拒绝它
               Explicitly disallow use of implicitly generated member functions
               you do not want.
 Section 5: 类与函数之实现 ( Classes and Functions: Implementation )
 Section 6: 继承关系与面向对象的设计 ( Inheritance and Object-Oriented Design )
 Section 7: 杂项讨论 ( Miscellany )
      Item 45: 清楚知道C++ ( 编译器 ) 默默为我们完成和调用哪些函数
               Know what functions C++ sliently writes and calls.
      Item 48: 不要对编译器的警告信息视如不见
               Pay attention to compiler warnings.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值