Next: High Integrity CPP Rule 9.3  Up: 9 Exceptions  Previous: High Integrity CPP Rule 9.1  Contents

High Integrity CPP Rule 9.2   Only throw objects of class type.
(QA C++  3500)

Justification

Exceptions pass information up the call stack to a point where error handling can be performed. Class types can have member data with information about the cause of the error, and also the class type itself is further documentation of the cause. User exception types should derive from std::exception or one of its derived classes.

Reference

Industrial Strength C++ 12.11;


HICPP VERSION 2.4  http://www.codingstandard.com   Copyright: © 2007 THE PROGRAMMING RESEARCH GROUP