O'Reilly logo

The C++ Programming Language, Fourth Edition by Bjarne Stroustrup

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13. Exception Handling

Don’t interrupt me while I’m interrupting.

– Winston S. Churchill

Error Handling

Exceptions; Traditional Error Handling; Muddling Through; Alternative Views of Exceptions; When You Can’t Use Exceptions; Hierarchical Error Handling; Exceptions and Efficiency

Exception Guarantees

Resource Management

Finally

Enforcing Invariants

Throwing and Catching Exceptions

Throwing Exceptions; Catching Exceptions; Exceptions and Threads

A vector Implementation

A Simple vector; Representing Memory Explicitly; Assignment; Changing Size

Advice

13.1. Error Handling

This chapter presents error handling using exceptions. For effective error handling, the language mechanisms must be used based on a strategy. Consequently, this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required