Item2 理解auto 的类型推导 auto 的类型推导与template 的类型推导类似,主要的区别在于对于 std::initialize_list 的区别。 在这个子项中的类型推导我们用到了boost
《Effective Modern C++》读书笔记(4)
Item 7区分使用 () 和{}创建对象 1. 基本数据类型 1 2 3 4 5 6 7 void BaseTypeUse() { int x(0); int y=0; int z{0}; int z2={0}; } 2.标准库的数据类型 1 2 3 4 5 6 7 8 void VectorUse() { std::vector<int> v{1,3,4,5}; std::map<int,std::string> m{ {1,"ok"}, {2,"over"} }; } 3
《Effective Modern C++》读书笔记(5)"
item8 使用nullptr代替0和NULL 1. 使用nullptr能更好的进行函数重载 函数声明: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 void PointerOverLoad(int x) { std::cout << "int Function"<< x <<std::endl; } void PointerOverLoad(bool