Original Post
While I thought I knew about try and catch, this has me completely confused. What is the "throw (string)" after the function name used for, and how come in the function the catch block is doing a throw, I thought the try block did a throw.
/*! Arena constructor (four parameters)
* In this constructor we specify the width, height, bits per pixel for the
* display (default:16) and the SDL display flags (default: SDL_SWSURFACE).
* These are the exact same four parameters that one would normally pass to
* SDL_SetVideoMode().
* Note that a whole range of potential errors could occur here; they are
* thrown as a std::string. Make sure you handle the exception in the calling
* code. */
Arena::Arena(int width,int height,int bpp,Uint32 flags) throw (string)
{
try
{
initScreen(width,height,bpp,flags);
xmin=ymin=0;
xmax=screen->w;
ymax=screen->h;
updateWhole=overflowUpdateWhole=false;
font=NULL;
nUpdateRects=0; // NEW 0.3
}
catch (string error)
{
throw;
}
}