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 4
class fast_exception
{
public:
fast_exception(int what, char const* file=0, int line=0)
: what_(what), line_(line), file_(file)
{/*empty*/}
int what() const { return what_; }
int line() const { return line_; }
char const* file() const { return file_; }
private:
int what_;
int line_;
char const* file_;
};