Ch19.10: De-fragmenting C++

中文(简体)

Watch This Before You Write Another throw

This chapter argued that legacy exceptions are a problem of the mechanism, not of the people using it. That argument is not new: Herb Sutter made it in 2019, in a talk that is the origin of everything this chapter taught. The talk is De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable, and it is worth the hour for two reasons: it shows the same measurements from the other side (binary size, the cost of a throw), and it presents the design that became the throws channel you have been using since Ch3.16.

The Talk

What to listen for, in the order the talk raises it:

After the Video

Come back to this chapter with the questions the talk leaves open, because the pages answer them concretely:

The rest of this book uses the mechanism the talk proposed, everywhere, without exception. Chapter 20 is the payoff: it is the reason the mechanism matters, because it is the chapter about running on targets where nothing else works.