Exceptional C++ Style 40 New Engineering Puzzles, Programming Problems, and Solutions
PART I Generic Programming and the C++ Standard Library
Chapter 1. Uses and Abuses of vector
Solution
Chapter 2. The String Formatters of Manor Farm, Part 1: sprintf
Solution
Chapter 3. The String Formatters of Manor Farm, Part 2: Standard (or Blindingly Elegant) Alternatives
Solution
Chapter 4. Standard Library Member Functions
Solution
Chapter 5. Flavors of Genericity, Part 1: Covering the Basis [sic]
Solution
Chapter 6. Flavors of Genericity, Part 2: Generic Enough?
Solution
Chapter 7. Why Not Specialize Function Templates?
Solution
Chapter 8. Befriending Templates
Solution
Chapter 9. Export Restrictions, Part 1: Fundamentals
Solution
- A Tale of Two Models
- Illustrating the Issues
- Export InAction [sic]
- Issue the First: Source Exposure
- Issue the Second: Dependencies and Build Times
- Summary
Chapter 10. Export Restrictions, Part 2: Interactions, Usability Issues, and Guidelines
Solution
Exception Safety Issues and Techniques
Chapter 11. Try and Catch Me
Solution
Chapter 12. Exception Safety: Is It Worth It?
Solution
Chapter 13. A Pragmatic Look at Exception Specifications
Solution
PART II Class Design, Inheritance, and Polymorphism
Chapter 14. Order, Order!
Solution
Chapter 15. Uses and Abuses of Access Rights
Solution
Chapter 16. (Mostly) Private
Solution
Chapter 17. Encapsulation
Solution
Chapter 18. Virtuality
Solution
Chapter 19. Enforcing Rules for Derived Classes
Solution
PART III Memory and Resource Management
Chapter 20. Containers in Memory, Part 1: Levels of Memory Management
Solution
Chapter 21. Containers in Memory, Part 2: How Big Is It Really?
Solution
Chapter 22. To new, Perchance to throw, Part 1: The Many Faces of new
Solution
- In-Place, Plain, and Nothrow new
- Class-Specific new
- A Name-Hiding Surprise
- Summary
Chapter 23. To new, Perchance to throw, Part 2: Pragmatic Issues in Memory Management
Solution
Optimization and Efficiency
Chapter 24. Constant Optimization?
Solution
Chapter 25. inline Redux
Solution
Chapter 26. Data Formats and Efficiency, Part 1: When Compression Is the Name of the Game
Solution
Chapter 27. Data Formats and Efficiency, Part 2: (Even Less) Bit-Twiddling
Solution
PART IV Traps, Pitfalls, and Puzzlers
Chapter 28. Keywords That Aren't (or, Comments by Another Name)
Solution
Chapter 29. Is It Initialization?
Solution
Chapter 30. double or Nothing
Solution
Chapter 31. Amok Code
Solution
Chapter 32. Slight Typos? Graphic Language and Other Curiosities
Solution
Chapter 33. Operators, Operators Everywhere
Solution
Style Case Studies
Chapter 34. Index Tables
Solution
Chapter 35. Generic Callbacks
Solution
Chapter 36. Construction Unions
Solution
Chapter 37. Monoliths "Unstrung," Part 1: A Look at std::string
Solution
Summary
Chapter 38. Monoliths "Unstrung," Part 2: Refactoring std::string
Solution
Chapter 39. Monoliths "Unstrung," Part 3: std::string Diminishing
Solution
Chapter 40. Monoliths "Unstrung," Part 4: std::string Redux
Solution