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.

<Effective C++>读书摘要--Introduction的更多相关文章

  1. <Effective C++>读书摘要--Designs and Declarations<一>

    <Item 18> Make interfaces easy to use correctly and hard to use incorrectly 1.That being the c ...

  2. <Effective C++>读书摘要--Inheritance and Object-Oriented Design<一>

    1.Furthermore, I explain what the different features in C++ really mean — what you are really expres ...

  3. <Effective C++>读书摘要--Implementations<二>

    <Item29> Strive for exception-safe code. 1.如下面的代码 class PrettyMenu { public: ... void changeBa ...

  4. <Effective C++>读书摘要--Implementations<一>

    1.For the most part, coming up with appropriate definitions for your classes (and class templates) a ...

  5. <Effective C++>读书摘要--Accustoming Youself to C++

    <Item 1>View C++ as a federation of languages. 1.把C++看成4种子语言组成,即C.Object-Oriented C++.Template ...

  6. <Effective C++>读书摘要--Templates and Generic Programming<一>

    1.The initial motivation for C++ templates was straightforward: to make it possible to create type-s ...

  7. <Effective C++>读书摘要--Inheritance and Object-Oriented Design<二>

    <Item 36> Never redefine an inherited non-virtual function 1.如下代码通过不同指针调用同一个对象的同一个函数会产生不同的行为Th ...

  8. <Effective C++>读书摘要--Designs and Declarations<三>

    <Item 22> Declare data members private 1.使数据成员private,保持了语法的一致性,client不会为访问一个数据成员是否需要使用括号进行函数调 ...

  9. <Effective C++>读书摘要--Designs and Declarations<二>

    <Item 20> Prefer pass-by-reference-to-const to pass-by-value 1.By default, C++ passes objects ...

随机推荐

  1. .Net Core使用Redis-从安装到使用

    一.安装 本文使用的操作系统是Centos7 在Redis中文网下载最新的Redis压缩包:http://www.redis.cn/ 把包上传到Liunx服务器上,cd 到包所在的目录执行以下命令 # ...

  2. Java Web项目里 classpath 具体指哪个路径

    classpath路径指什么 只知道把配置文件如:mybatis.xml.spring-web.xml.applicationContext.xml等放到src目录(就是存放代码.java文件的目录) ...

  3. Debian中CodeIgniter+nginx+MariaDB+phpMyAdmin配置

    本文不讲述软件安装过程,记述本人在Debia中配置CodeIgniter时遇到的问题及解决方法,希望能够为有需要的人提供帮助. 一.Debian版本及所需的软件 Debian 9.8 stretch ...

  4. YII2.0 后台手动添加用户功能

    后台添加管理员用户使用SignupForm类实现 步骤一.复制一份前台frontend/models/SignupForm.php 到后台模型文件夹中 backend/models/SignupFor ...

  5. day 16 初试面试对象

    1.初识面向对象      面向过程:             一切以事物的发展流程为中心      面向对象:             一切以对象为中心.一切皆为对象.具体的某一个事务就是对象 打比 ...

  6. Python学习 :常用模块(一)

    常用模块(一) 一.时间(time)模块 时间戳 (Timestamp):时间戳表示的是从1970年1月1日00:00:00为计时起点,到当前的时间长度 import time print(help( ...

  7. 1010 一元多项式求导 (25 分) C语言

    设计函数求一元多项式的导数.(注:x​n​​(n为整数)的一阶导数为nx​n−1​​.) 输入格式: 以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过 1000 的整数).数字间以空格分隔. ...

  8. 20145202马超 2016-2017-2 《Java程序设计》第11周学习总结

    20145202马超 2016-2017-2 <Java程序设计>第11周学习总结 教材学习内容总结 XX 教材学习中的问题和解决过程 教材学习有问题先去https://shimo.im/ ...

  9. Jedis+Redis+spring缓存

    Redis程序使用它?Jedis 访问redis java api Redis-server & //后台运行防火墙要关闭 ts-parent的pom.xml加上jedis依赖 <dep ...

  10. 佛山Uber优步司机奖励政策(1月4日~1月10日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...