class exception : public std::exception {
//where_ is a description of exception context
const char *where_, *what_;
int errnum_;
public:
exception(const char *where, const char *what)
:where_(where),what_(what),errnum_(0){}
exception(const char *where, int errnum)
:where_(where),what_(NULL),errnum_(errnum){}
inline const char *what() const
{return what_ ? what_ : strerror(errnum_);}
inline const char *where() const {return where_;}
int which() const {return errnum_;}
};
End of Listing