## 19.3.2 (cont.) Inheriting From Standard Exceptions

- Use library exceptions as-is (see initial example), or
- Inherit from these to create further specialized categories:

  >     class FutureValueError : public logic_error
  >     {
  >     public:
  >        FutureValueError(string reason);
  >     };

  >     FutureValueError::FutureValueError(string reason)
  >        : logic_error(reason) {}

  - No added attributes or functionality
  - C'tor passes its argument to its parent class' c'tor
- All subclasses of `exception` have a `what()` method

prev |top |next