27.5 — Exceptions, classes, and inheritance

Exceptions and member functions Up to this point in the tutorial, you’ve only seen exceptions used in non-member functions. However, exceptions are equally useful in member functions, and even more so in overloaded operators. Consider the following overloaded [] operator as part of a simple integer array class: int& IntArray::operator[](const …