《Exceptional C++ Style》PDF下载

  • 购买积分:12 如何计算积分?
  • 作  者:(美)Herb Sutter著
  • 出 版 社:北京:机械工业出版社
  • 出版年份:2006
  • ISBN:711118484X
  • 页数:325 页
图书介绍:本书对C++编程风格进行介绍。

Generic Programming and the C++ Standard Library 1

1. Uses and Abuses of vector 10

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

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

4. Standard Library Member Functions 27

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

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

7. Why Not Specialize Function Templates? 42

8. Befriending Templates 49

9. Export Restrictions, Part 1: Fundamentals 59

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

Exception Safety Issues and Techniques 79

11. Try and Catch Me 80

12. Exception Safety: Is It Worth It? 85

13. A Pragmatic Look at Exception Specifications 89

Class Design, Inheritance, and Polymorphism 99

14. Order, Order! 100

15. Uses and Abuses of Access Rights 104

16. (Mostly) Private 110

17. Encapsulation 119

18. Virtuality 129

19. Enforcing Rules for Derived Classes 139

Memory and Resource Management 151

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

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

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

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

Optimization and Efficiency 183

24. Constant Optimization? 184

25. inline Redux 190

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

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

Traps, Pitfalls, and Puzzlers 213

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

29. Is It Initalizafion? 221

30. double or Nothing 227

31. Amok Code 230

32. Slight Typos? Graphic Language and Other Curiosities 235

33. Operators, Operators Everywhere 239

Style Case Studies 245

34. Index Tables 246

35. Generic Callbacks 258

36. Construction Unions 267

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

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

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

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

Bibliography 315

Index 319