Space in Template Expression, nullptr, and auto

Automatic Type Deduction with auto

With C++11, you can declare a variable or an object without specifying its type by using auto. For example:

auto i = 42; // i has type int
double f();
auto d = f(); // d has type double

Using auto is especially useful where the type is a pretty long and/or complicated expression. For example:

vector<string> v;
auto pos = v.begin(); // pos has type vector<string>::iterator

Space in Template Expression

vector<list<int> > // before c++11, you must write like this
vector<list<int>>  // after c++11, you can write like this

nullptr

原文地址:https://www.cnblogs.com/Codroc/p/13998435.html