Effective C++读书笔记

Effective C++确实是一本好书,虽然现在看得还一知半解。

item1: View C++ as a federation of languages

视C++ 为一个语言联邦

item2: Perfer consts,enums,and inlines to defines

尽量以const,enum,inline替换 #define

item3: Use const whenever possible

尽可能使用const

item4:Make sure that objects are initialized before they are used

对象使用前要初始化

item5: Know what functions C++ silently writes and calls

了解C++默默编写并调用的哪些函数

item6: Explicity disallow the use of compiler-generated functions you do not want

若不想使用编译器自动生成的函数,就应该明确拒绝

item7: Declare destructors virtual in polymorphic base classes

为多态基类声明virtual 析构函数

item8: Prevent exceptions from leaving destructors

别让异常逃离析构函数

item9: Never call virtual functions during construction or destruction

绝不在构造和析构函数中调用virtual 函数

item10: Having assignment operators return a reference to *this

令operator = 返回一个reference to *this

item11: Handle assignment to self in operator

在operator =中处理自我赋值

item12: Copy all parts of an object

复制对象时勿忘其每个部分

item13: Use objects to manage resources

使用对象来管理资源

item14: Think carefully about copying behavior in resource-managing classes

在资源管理类中小心coping 行为

item15: Provide access to raw resources in resource-managing classes

在资源管理类中提供对原始资源的访问

item16: Use the same form in corresponding uses of new and delete

new 和delete时使用相同的形式

item17: Stored newed objects in smart pointers in standalone statements
item18 : Make interfaces easy to use correctly and hard to use incorrectly
item19: Treat class design as type design
item20: Prefer pass-by- reference -to-const to pass-by-value
item21: Don’t try to return a reference when you must return a object
item22: Declare data members private
item 23: Prefer non-member non-friend functions to member function
item24: Declare non-member functions when type conversions should apply to all parameters
item25: Consider support for a non-throwing swap
item26: Postpone variable definitions as long as possible
item27: Minimize casting
item28: Avoid returning “handles” to object internals
item29: Strive for exception-safe code
item30: Understand the ins and outs of inlining
item31: Minimze compilation dependencies between files
item32:
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值