Exceptional C++ Style - Book Home Page

Home Blog Talks Books & Articles Training & Consulting


On the
RSS feed November 4: Other Concurrency Sessions at PDC
November 3
: PDC'09: Tutorial & Panel
October 26: Hoare on Testing
October 23
: Deprecating export Considered for ISO C++0x

View current errata list

View the Bibliography

Exceptional C++ Style by Herb Sutter is the sequel to Herb's widely acclaimed books Exceptional C++ and More Exceptional C++. All are in Bjarne Stroustrup's C++ In Depth series.

Overview: Organized in the popular problem-and-solution format of Exceptional C++ and More Exceptional C++, this third book increases the focus on in-depth coverage of generic programming and the C++ standard library, along with exception safety, class design, memory and resource management, optimization and efficiency. It then concludes with four case studies that inspect and dissect actual published C++ code to see what it does well, what it does badly, and what choices we might make to improve the originally published solutions to exhibit better -- nay, exceptional -- C++ style.

This book is about providing successful strategies for solving real-world problems in C++. Like its predecessors, it draws on years of in-the-trenches experience, and provides tested techniques and practical solutions for programmers designing modern software systems with C++, from small projects to enterprise applications.

Contents: Built around 40 Items, Exceptional C++ Style helps you understand the rules and issues critical to successful software design and development in C++. Here is the table of contents:

Generic Programming and the C++ Standard Library

Item 1: Uses and Abuses of Vector

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

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

Item 4: Standard Library Member Functions

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

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

Item 7: Why Not Specialize Function Templates?

Item 8: Befriending Templates

Item 9: Export Restrictions, Part 1: Fundamentals

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

Exception Safety Issues and Techniques

Item 11: Try and Catch Me

Item 12: Exception Safety: Is It Worth It?

Item 13: A Pragmatic Look at Exception Specifications

Class Design, Inheritance, and Polymorphism

Item 14: Order, Order!

Item 15: Uses and Abuses of Access Rights

Item 16: (Mostly) Private

Item 17: Encapsulation

Item 18: Virtuality

Item 19: Enforcing Rules for Derived Classes

Memory and Resource Management

Item 20: Containers In Memory, Part 1: Levels of Memory Management

Item 21: Containers In Memory, Part 2: How Big Is It Really?

Item 22: To New, Perchance To Throw, Part 1: The Many Faces of New

Item 23: To New, Perchance To Throw, Part 2: Pragmatic Issues in Memory Management

Optimization and Efficiency

Item 24: Constant Optimization?

Item 25: Inline Redux

Item 26: Data Formats and Efficiency, Part 1: When Compression is the Name of the Game

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

Traps, Pitfalls, and Puzzlers

Item 28: Keywords That Aren’t (or, Comments By Another Name)

Item 29: Is It Initialization?

Item 30: Double or Nothing

Item 31: Amok Code

Item 32: Slight Typos? Graphic Language and Other Curiosities

Item 33: Operators, Operators Everywhere

Style Case Studies

Item 34: Index Tables

Item 35: Generic Callbacks

Item 36: Construction Unions

Item 37: Monoliths “Unstrung,” Part 1: A Look at std::string

Item 38: Monoliths “Unstrung,” Part 2: Refactoring std::string

Item 39: Monoliths “Unstrung,” Part 3: std::string Diminishing

Item 40: Monoliths “Unstrung,” Part 4: std::string Redux

A must-have for the serious programmer, Exceptional C++ Style provides a thorough and pragmatic understanding of the language while showing you how to write exceptional code in C++.

Besides containing additional new material and information from Herb's print articles and columns, Exceptional C++ Style is also the authoritative reference for Guru of the Week issues #63 to #86, with (often considerably) revised and enhanced solutions.


Thank you for your interest in GotW and the Exceptional C++ book series!

Herb Sutter

Convener, ISO WG21 (C++ standards committee)
Visual C++ architect, Microsoft

Copyright © 2009 Herb Sutter