1。explicit 防止隐式类型转换 

2。cbegin() cend()等价于返回 const_iterator 类型

3。it->mem 等价于 (*it).mem

4。不允许使用一个数组初始化另一个数组,也不能把一个数组赋值给另一个数组   int *ptrs[10];    int (*Parray)[10]=&arr; (指向一个含有10个整数的数组)

int (&arrRef)[10]=arr;(引用1个含有10个整数的数组)

5。强制类型转换 cast-name<type>(expression)      cast-name包括 static_cast  dynamic_cast   const_cast  reinterpret_cast

6。C++名字有作用域,对象有生命周期

7。如果一个函数永远不会被我们用到,那么它可以只有声明没有定义。(这样的函数有什么用?)

8。顶层const和底层const (针对指针而言)  底层const在执行对象的拷贝操作时,拷入和拷出对象必须具有相同的底层const资格,或者两个对象的数据类型必须能够转换

9。尾置返回类型 auto func(int i) ->int(*)[10] ;         decltype(array) *arr(int i) {...;}

10。const_cast 用于重载函数情景  当非常量实参调用常量函数时,重载函数中可用const_cast 

 posted on 2016-03-24 13:59  丶Defry  阅读(95)  评论(0)    收藏  举报