Listing 6 Additional code to make Borland's <except.h> header standard-conforming

// Standard exceptions (CDA, 4/21/94)
#define exception xmsg
#define alloc xalloc
#define what why

class logic : public exception
{
public:
   logic(const string& msg) : exception(msg) {}
   void raise() {throw *this;}
};

class domain : public logic
{
public:
   domain(const string& msg) : logic(msg) {}
   void raise() {throw *this;}
};

class runtime : public exception
{
public:
   runtime(const string& msg) : exception(msg) {}
   void raise() {throw *this;}
};

class range : public runtime
{
public:
   range(const string & msg) : runtime(msg) {}
   void raise() {throw *this;}
};

/* End of File */