Custom Exception Types
By Kurt Guntheroth, February 01, 2005
Exceptions are runtime events with three important properties-events interrupt normal execution, they occur infrequently, and code that responds to events is in high-level logic, far up the function call stack from code that detects events.
February, 2005: Custom Exception Types
Listing 6
class conservative_exception
{
public:
conservative_exception(int what, char const* file=0, int line=0);
int what() const { return what_; }
int line() const { return line_; }
char const* file() const { return file_0 !=0 ? file_:0; }
private:
int what_;
int line_;
char file_[32];
};