Exceptional C++ Style : 40 New Engineering Puzzles, Programming Problems, and Solutions
暫譯: 卓越的 C++ 風格:40 道新工程難題、程式設計問題與解答

Herb Sutter

買這商品的人也買了...

相關主題

商品描述

Table of Contents:

Preface.

GENERIC PROGRAMMING AND THE C++ STANDARD LIBRARY.

1. Uses and Abuses of vector.

2. The String Formatters of Manor Farm, Part 1: sprintf.

3. The String Formatters of Manor Farm, Part 2: Standard (or Blindingly Elegant) Alternatives.

4. Standard Library Member Functions.

5. Flavors of Genericity, Part 1: Covering the Basis [sic].

6. Flavors of Genericity, Part 2: Generic Enough?

7. Why Not Specialize Function Templates?

8. Befriending Templates.

9. Export Restrictions, Part 1: Fundamentals.

10. Export Restrictions, Part 2: Interactions, Usability Issues, and Guidelines.

EXCEPTION SAFETY ISSUES AND TECHNIQUES.

11. Try and Catch Me.

12. Exception Safety: Is It Worth It?

13. A Pragmatic Look at Exception Specifications.

CLASS DESIGN, INHERITANCE, AND POLYMORPHISM.

14. Order, Order!

15. Uses and Abuses of Access Rights.

16. (Mostly) Private.

17. Encapsulation.

18. Virtuality.

19. Enforcing Rules for Derived Classes.

MEMORY AND RESOURCE MANAGEMENT.

20. Containers in Memory, Part 1: Levels of Memory Management.

21. Containers in Memory, Part 2: How Big Is It Really?

22. To new, Perchance to throw, Part 1: The Many Faces of new.

23. To new, Perchance to throw, Part 2: Pragmatic Issues in Memory Management.

OPTIMIZATION AND EFFICIENCY.

24. Constant Optimization?

25. inline Redux.

26. Data Formats and Efficiency, Part 1: When Compression Is the Name of the Game.

27. Data Formats and Efficiency, Part 2: (Even Less) Bit-Twiddling.

TRAPS, PITFALLS, AND PUZZLERS.

28. Keywords That Aren't (or, Comments by Another Name).

29. Is It Initialization?

30. double or Nothing.

31. Amok Code.

32. Slight Typos? Graphic Language and Other Curiosities.

33. Operators, Operators Everywhere.

STYLE CASE STUDIES.

34. Index Tables.

35. Generic Callbacks.

36. Construction Unions.

37. Monoliths "Unstrung," Part 1: A Look at std::string.

38. Monoliths "Unstrung," Part 2: Refactoring std::string.

39. Monoliths "Unstrung," Part 3: std::string Diminishing.

40. Monoliths "Unstrung," Part 4: std::string Redux.

Bibliography.

Index.

商品描述(中文翻譯)

目錄:

前言。

通用程式設計與 C++ 標準函式庫。
1. vector 的使用與濫用。
2. 曼諾農場的字串格式化器,第 1 部分:sprintf
3. 曼諾農場的字串格式化器,第 2 部分:標準(或極其優雅)的替代方案。
4. 標準函式庫成員函式。
5. 通用性的風味,第 1 部分:涵蓋基礎 [sic]。
6. 通用性的風味,第 2 部分:夠通用嗎?
7. 為什麼不專門化函式模板?
8. 友好的模板。
9. 匯出限制,第 1 部分:基本原則。
10. 匯出限制,第 2 部分:互動性、可用性問題與指導方針。

例外安全問題與技術。
11. 嘗試並捕捉我。
12. 例外安全:值得嗎?
13. 實用的例外規範觀察。

類別設計、繼承與多型。
14. 秩序,秩序!
15. 存取權限的使用與濫用。
16. (大多)私有。
17. 封裝。
18. 虛擬性。
19. 強制衍生類別的規則。

記憶體與資源管理。
20. 記憶體中的容器,第 1 部分:記憶體管理的層級。
21. 記憶體中的容器,第 2 部分:它實際上有多大?
22. 要 new,或許要 throw,第 1 部分:new 的多種面貌。
23. 要 new,或許要 throw,第 2 部分:記憶體管理中的實用問題。

優化與效率。
24. 常數優化?
25. inline Redux。
26. 數據格式與效率,第 1 部分:當壓縮成為遊戲的名稱。
27. 數據格式與效率,第 2 部分:(甚至更少的)位元操作。

陷阱、險境與難題。
28. 不是關鍵字的關鍵字(或,另一種名稱的註解)。
29. 這是初始化嗎?
30. double 或無。
31. 失控的程式碼。
32. 輕微的錯字?圖形語言與其他好奇事物。
33. 操作符,處處都是操作符。

風格案例研究。
34. 索引表。
35. 通用回呼。
36. 建構聯合。
37. 解構的巨型物,第 1 部分:std::string 的觀察。
38. 解構的巨型物,第 2 部分:重構 std::string
39. 解構的巨型物,第 3 部分:std::string 的減少。
40. 解構的巨型物,第 4 部分:std::string Redux。

參考文獻。
索引。