隻使用 Boost 中被認可的庫.
定義:
Boost 庫集 是一個廣受歡迎, 經過同行鑒定, 免費開源的 C++ 庫集.
優點:
Boost代碼品質普遍較高, 可移植性好, 填補了 C++ 标準庫很多空白, 如型别的特性, 更完善的綁定器, 更好的智能指針。
缺點:
某些 Boost 庫提倡的程式設計實踐可讀性差, 比如元程式設計和其他進階模闆技術, 以及過度 “函數化” 的程式設計風格.
結論:
為了向閱讀和維護代碼的人員提供更好的可讀性, 我們隻允許使用 Boost 一部分經認可的特性子集. 目前允許使用以下庫:
- Call Traits : boost/call_traits.hpp
- Compressed Pair : boost/compressed_pair.hpp
- < The Boost Graph Library (BGL) : boost/graph, except serialization (adj_list_serialize.hpp) and parallel/distributed algorithms and data structures(boost/graph/parallel/* and boost/graph/distributed/*)
- Property Map : boost/property_map.hpp
- The part of Iterator that deals with defining iterators: boost/iterator/iterator_adaptor.hpp, boost/iterator/iterator_facade.hpp, and boost/function_output_iterator.hpp
- The part of Polygon that deals with Voronoi diagram construction and doesn’t depend on the rest of Polygon: boost/polygon/voronoi_builder.hpp, boost/polygon/voronoi_diagram.hpp, and boost/polygon/voronoi_geometry_type.hpp
- Bimap : boost/bimap
- Statistical Distributions and Functions : boost/math/distributions
- Multi-index : boost/multi_index
- Heap : boost/heap
- The flat containers from Container: boost/container/flat_map, and boost/container/flat_set
我們正在積極考慮增加其它 Boost 特性, 是以清單中的規則将不斷變化.
以下庫可以用,但由于如今已經被 C++ 11 标準庫取代,不再鼓勵:
- Pointer Container : boost/ptr_container, 改用 std::unique_ptr
- Array : boost/array.hpp, 改用 std::array