Gold mine of Visual C++ tricks!
Posts tagged Add new tag
Use throw; carefully. Or else, Unhandled exception will be the result.
01389 days
by Jijo Raj
in Uncategorized
![]()
Usually throw; is used to rethrow the exception object. But you should be careful. If you call throw; where there is no exception object in the context, then it will result an un-handled exception and abnormal program termination. The interesting part is that, even catch(…) cannot catch such exceptions.
![]()
See the sample code snippet below.
try
{
throw;
}
catch( ... )
{
}
So take care next time.
![]()
Targeted Audience – Intermedite.