## Tuple 總結
Tuple 庫為C++帶來了 tuples 的概念。它是符合直覺和簡單明了的,雖然它的主要用途看起來就是用于從函數返回多個返回值,但它也可以用于創建各種邏輯組合,就象在標準庫容器中保存一組元素一樣。這種方法和為各個不同的返回類型創建一個 `struct` 是相同的,但后者不僅沉悶,而且不可能作出遞歸的泛型解決方案。使用 Boost.Tuple 就可以解決這些問題。
在本章中,我們看到了如何使用 Tuple 庫,以及如何用函數對象擴充它,還有如何對 tuple 使用算法。通過索引來訪問元素,以及 `get_head`/`get_tail` 成員函數,提供了使用 `tuple`s 的一致性,使得許多解決方案可以實現,而使用用戶定義類型(UDTs)時是不可能的。
Boost.Tuple 的創建者,Jaakko J?rvi,應該為這個杰出的庫獲得榮譽。他的努力有力地證明了,幾乎所有C++中缺少的東西都可以由天才的設計者通過庫增加進來。
- 序
- 前言
- Acknowledgments
- 關于作者
- 本書的組織結構
- Boost的介紹
- 字符串及文本處理
- 數 據結構, 容器, 迭代器, 和算法
- 函數對象及高級編程
- 泛 型編程與模板元編程
- 數學及數字處理
- 輸入/輸出
- 雜項
- Part I: 通用庫
- Library 1. Smart_ptr
- Smart_ptr庫如何改進你的程序?
- 何時我們需要智能指針?
- Smart_ptr如何適應標準庫?
- scoped_ptr
- scoped_array
- shared_ptr
- shared_array
- intrusive_ptr
- weak_ptr
- Smart_ptr總結
- Library 2. Conversion
- Conversion 庫如何改進你的程序?
- polymorphic_cast
- polymorphic_downcast
- numeric_cast
- lexical_cast
- Conversion 總結
- Library 3. Utility
- Utility 庫如何改進你的程序?
- BOOST_STATIC_ASSERT
- checked_delete
- noncopyable
- addressof
- enable_if
- Utility 總結
- Library 4. Operators
- Operators庫如何改進你的程序?
- Operators
- 用法
- Operators 總結
- Library 5. Regex
- Regex庫如何改進你的程序?
- Regex 如何適用于標準庫?
- Regex
- 用法
- Regex 總結
- Part II: 容器及數據結構
- Library 6. Any
- Any 庫如何改進你的程序?
- Any 如何適用于標準庫?
- Any
- 用法
- Any 總結
- Library 7. Variant
- Variant 庫如何改進你的程序?
- Variant 如何適用于標準庫?
- Variant
- 用法
- Variant 總結
- Library 8. Tuple
- Tuple 庫如何改進你的程序?
- Tuple 庫如何適用于標準庫?
- Tuple
- 用法
- Tuple 總結
- Part III: 函數對象與高級編程
- Library 9. Bind
- Bind 庫如何改進你的程序?
- Bind 如何適用于標準庫?
- Bind
- 用法
- Bind 總結
- Library 10. Lambda
- Lambda 庫如何改進你的程序?
- Lambda 如何適用于標準庫?
- Lambda
- 用法
- Lambda 總結
- Library 11. Function
- Function 庫如何改進你的程序?
- Function 如何適用于標準庫?
- Function
- 用 法
- Function 總結
- Library 12. Signals
- Signals 庫如何改進你的程序?
- Signals 如何適用于標準庫?
- Signals
- 用法
- Signals 總結