Empty Throws
So, we can see now how powerful and useful this "new" method is. A try-catch block can contain another try-catch block, and this block can throw anything, too, which will be caught by the outer catch if there is no corresponding inner catch, or the catch throws something. One thing I have neglected to mention is that throw need not even have anything after it:
Code:
try
{
throw;
}
catch(...)
{
cout << "Caught exception!" << endl;
}
This could be used in extreme situations where you don't even care what was thrown.