4

Error Handling

Don’t interrupt me while I’m interrupting.

– Winston S. Churchill

4.1 Introduction

Error handling is a large and complex topic with concerns and ramifications that go far beyond language facilities into programming techniques and tools. However, C++ provides a few features to help. The major tool is the type system itself. Instead of painstakingly building up our applications from the built-in types (e.g., char, int, and double) and statements (e.g., if, while, and for), we build types (e.g., string, map, and thread) and algorithms (e.g., sort(), find_if(), and draw_all()) that are appropriate for our applications. ...

Get A Tour of C++, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.