九、杂项讨论
Item53. 不要轻忽编译器的警告
比如:
编译器会警告:
warning: D::f() hides virtual B::f()
因为D中的f()没有const。
Item54. 让自己熟悉包括TR1在内的标准程序库
TR1组件有:
1. The smart pointers TR1::shared_ptr 和 tr1::weak_ptr. TR1::shared_ptrs
2. tr1::function(Item35)
3. tr1::bind(Item35)
其他TR1组件划分为两组:
①Hash tables、Regular expressions、Tuples、tr1::array、tr1::mem_fn、tr1::reference_wrapper、Random number generation、Mathematical special functions、C99 compatibility extension
②Type traits、tr1::result_of
简单示范:
①tr1::function
ITem55. 让自己熟悉Boost(http://boost.org)
Boost程序库的主题主要有:
String and text processing、Containers、Function objects and higher-order programming、Generic programming、Template metaprogramming(TMP)、Math and numerics、Correctness and testing、Data structures、Inter-language support、Memory、Miscellaneous
简单示范:
①Function objects and higher-order programming
②Template metaprogramming(TMP)