class ParseException {public: // constructors ParseException (string & why) : reason(why) { } ParseException (ParseException & why) : reason(why.reason) { } // operators void operator = (ParseException & why)
class ParseException {public: // constructors ParseException (string & why) : reason(why) { } ParseException (ParseException & why) : reason(why.reason) { } // operators void operator = (ParseException & why)
{ reason = why.reason; } operator string () { return reason; } private: string reason;}...// throw an error, creates a temporary valuethrow ParseException("missing expression");