Book description
Software "style" is about finding the perfect balance between overhead and functionality... elegance and maintainability... flexibility and excess. In Exceptional C++ Style, legendary C++ guru Herb Sutter presents 40 new programming scenarios designed to analyze not only the what but the why and help you find just the right balance in your software.
Organized around practical problems and solutions, this book offers new insight into crucial C++ details and interrelationships, and new strategies for today's key C++ programming techniques--including generic programming, STL, exception safety, and more. You'll find answers to questions like:
What can you learn about library design from the STL itself?
How do you avoid making templated code needlessly non-generic?
Why shouldn't you specialize function templates? What should you do instead?
How does exception safety go beyond try and catch statements?
Should you use exception specifications, or not?
When and how should you "leak" the private parts of a class?
How do you make classes safer for versioning?
What's the real memory cost of using standard containers?
How can using const really optimize your code?
How does writing inline affect performance?
When does code that looks wrong actually compile and run perfectly, and why should you care?
What's wrong with the design of std::string?
Exceptional C++ Style will help you design, architect, and code with style--and achieve greater robustness and performance in all your C++ software.
Table of contents
- Copyright
- The C++ In-Depth Series
- Preface
- ##. The Topic of This Item
-
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
-
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
-
Solution
- Implicitly Generated Functions (or, What the Compiler Does for/to You)
- Exception Specifications of Implicitly Declared Functions
- Implicit Default Constructor
- Implicit Copy Constructor
- Implicit Copy Assignment Operator
- Implicit Destructor
- An auto_ptr Member
- Renegade Children and Other Family Problems
- Enforcing Rules for Derived Classes
- Summary
-
Solution
- Memory and Resource Management
- Optimization and Efficiency
- Traps, Pitfalls, and Puzzlers
- Style Case Studies
Product information
- Title: Exceptional C++ Style 40 New Engineering Puzzles, Programming Problems, and Solutions
- Author(s):
- Release date: August 2004
- Publisher(s): Addison-Wesley Professional
- ISBN: 0201760428
You might also like
book
Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions
shows by example how to go about sound software engineering in standard C++. Do you enjoy …
book
Practical C++ Programming, 2nd Edition
C++ is a powerful, highly flexible, and adaptable programming language that allows software engineers to organize …
video
Beginning C++ Programming
In this C++ for Beginners training course, expert author John Dubchak will teach you everything you …
book
Discovering Modern C++: An Intensive Course for Scientists, Engineers, and Programmers
As scientific and engineering projects grow larger and more complex, it is increasingly likely that those …