17 Exception Handling: A Deeper Look
Objectives
In this chapter you’ll:
Understand the exception-handling flow of control with
try
,catch
andthrow
.Define new exception classes.
Understand how stack unwinding enables exceptions not caught in one scope to be caught in another.
Handle
new
failures.Use
unique_ptr
(a Standard Library “smart pointer” class) to prevent memory leaks.Understand the standard exception hierarchy.
Get C++ How to Program, 10/e 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.