Introduction

1、Learning the fundamentals of a programming language is one thing; learning how to design and implement effective programs in that language is something else entirely.

想起<重构>里面说的一句话,写出计算机能理解的代码很容易,但是写好人能理解的代码不容易

2、A declaration tells compilers about the name and type of something, but it omits certain details.

3、Initialization is the process of giving an object its first value.

4、Constructors declared explicit are usually preferable to non-explicit ones, because they prevent compilers from performing unexpected (often unintended) type conversions. Unless I have a good reason for allowing a constructor to be used for implicit type conversions, I declare it explicit.

explicit 关键字限制不能进行隐式转换

5、The copy constructor is used to initialize an object with a different object of the same type, and the copy assignment operator is used to copy the value from one object to another of the same type

 class Widget {
public:
Widget(); // default constructor
Widget(const Widget& rhs); // copy constructor
Widget& operator=(const Widget& rhs); // copy assignment operator
...
};
Widget w1; // invoke default constructor
Widget w2(w1); // invoke copy constructor
10 w1 = w2; // invoke copy assignment operator</span>
Widget w3 = w2; // invoke copy constructor!</span>

pass by value 的时候使用的是copy constructor

6、undefined behavior:编译器不确定行为,如数组越界访问,dereference一个空指针等

7、When I use the term "interface," I'm generally talking about a function's signature, about the accessible elements of a class (e.g., a class's "public interface," "protected interface," or "private interface"), or about the expressions that must be valid for a template's type parameter (see Item 41).

8、A client is someone or something that uses the code (typically the interfaces) you write.

9、Two of my favorite parameter names, for example, are lhs and rhs. They stand for "left-hand side" and "right-hand side," respectively.

10、I often name pointers following the rule that a pointer to an object of type T is called pt. I use a similar convention for references: rw might be a reference to a Widget and ra a reference to an Airplane. I occasionally use the name mf when I'm talking about member functions.

11、As a language, C++ has no notion of threads — no notion of concurrency of any kind, in fact.

12、TR1 ("Technical Report 1") is a specification for new functionality being added to C++'s standard library.This functionality takes the form of new class and function templates for things like hash tables, reference-counting smart pointers, regular expressions, and more. All TR1 components are in the namespace tr1 that's nested inside the namespace std.

13、Boost is an organization and a web site (http://boost.org) offering portable, peer-reviewed, open source C++ libraries. Most TR1 functionality is based on work done at Boost, and until compiler vendors include TR1 in their C++ library distributions, the Boost web site is likely to remain the first stop for developers looking for TR1 implementations. Boost offers more than is available in TR1, however, so it's worth knowing about in any case.

最新文章

  1. PYTHON 集合set 方法
  2. java类加载器的层次结构
  3. 设置textview显示框内容不可编辑不可选择。
  4. js String Trim函数
  5. eclipse的设置和优化
  6. jdbcTemplate 获取数据表结构
  7. C# 里窗体里(windows form)怎么播放音乐
  8. 【宽搜】Vijos P1051 送给圣诞夜的极光
  9. Java虚拟机中Java内存区域
  10. Java集合框架(二)
  11. CSAPP-链接
  12. 【Linux学习笔记】关于ubuntu开机菜单栏和任务栏不见了的有效解决方法
  13. LoadRunner基础知识
  14. vs2017安装pygame,vs2017安装python第三方包
  15. Flink神秘工具lib
  16. Cookiecutter: 更好的项目模板工具:(3)高级用法
  17. .NET Core 使用 Kestrel
  18. MongoDB update修改器 目录
  19. 平衡二叉树-AVL树(LL、RR、LR、RL旋转)
  20. node.js发送邮件email

热门文章

  1. 「PHP」设计模式介绍
  2. ubuntu下的数据库和python存储库安装——MySQL,MongoDB,Redis
  3. 使用ntp协议同步本地时间(C语言)
  4. java的编码格式
  5. Java设计模式(14)——行为模式之不变模式(Immutable)
  6. 【Hutool】Hutool工具类之Http工具——HttpUtil
  7. 日志工具——slf4j
  8. 使用materialization
  9. PLSQL集合类型
  10. mysql优化理解笔记(持续更新)