九、杂项讨论
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)
本文探讨了C++编程中的重要实践,包括遵循编译器警告的重要性,介绍标准程序库TR1及其组件如smart pointers、function和bind等,并推荐熟悉Boost库以提升编程效率。
519

被折叠的 条评论
为什么被折叠?



