Effective c++ 9 53...55
53*不要轻忽编译器的警告
Pay attention to compiler warnings.
54*让自己熟悉包括TR1在内的标准程序库
Familiarize yourself with the standard library,including TR1.
C++98的内容:
STL(Standard Template Library,标准模板库):容器、迭代器、算法、函数对象、容器适配器、函数对象适配器。
Iostreams:用户自定缓冲功能(毛?),国际化I/O(毛?iostream等类?),对象:cin,cout,cerr,clog。
国际化支持:wchar_t和wstring。——>Unicode
数值处理:复数complex 纯数值数组valarray
异常阶层体系exception hierarchy:exception,logic_error, runtime_error,……
C89(毛?):1989C标准程序库。
STD::TR1::的内容:
智能指针:tr1::shared_ptr(环形数据结构中不适用),tr1::weak_ptr(针对环形问题,有待试试)(貌似是weak_ptr所指对象有被销毁的可能)。
tr1::function:35条。void registerCallback( std::tr1::function<std::string (int)> func);
tr1::bind:35条。可以代替STL的bind1st和bind2nd。
第一组:
Hash tables:tr1::unordered_set, tr1::unordered_multiset, tr1::unordered_map, tr1::unordered_multimap。以hash为基础的容器内的元素并无任何可预期的次序。
正则表达式:
Tuples变量组:pair template的新一代。tr1::tuple可以持有任意个数的对象。
tr1::array:支持成员函数begin和end的数组,大小固定。
tr1::men_fn:毛?
tr1::reference_wrapper:毛?
随机数生成工具:超越rand。
更多数学函数。
C99程序库。
第二组(模板):
Type traits:47条。提供类型信息等。
tr1::tesult_of:template。函数调用的返回类型。
53*让自己熟悉Boost
Familiarize yourself with Boost
http://www.boost.org/