Spaces in Template Expressions
vector<list<int> >; //可以在C++的版本,必须有空格
vector<list<int>>;//任何版本都可以这么编译通过了
nullptr and std::nullptr_t
C++11让我们使用nullptr 代替0或者NULL
void f(int)
void f(void*)
f(0);//calls f(int)
f(NULL);//call f(int) 如果NULL是0,其他的就不知道了
f(nullptr);//calls f(void*)
\include\stddef
typedef deltype(nullptr) nullptr_t;
Automatic Type Deduction whit auto
auto i = 42;//i是int类型
double f()
auto d = f();//d是doublue类型
- 好用的写法
vector<string> v;
...
auto pos = v.begin();// pos 的类型是vector<string>::iterator
auto l =(int x)->bool{}; //l是一个lambad表达式