December 2001
Intermediate to advanced
304 pages
6h 25m
English
Difficulty: 6
What is the standard function uncaught_exception(), and when should it be used? The answer given here isn't one that most people expect.
What does std::uncaught_exception() do?
Consider the following code:
T::~T()
{
if( !std::uncaught_exception() )
{
// ... code that could throw ...
}
else
{
// ... code that won't throw ...
}
}
Is this a good technique? Present arguments for and against.
Is there any other good use for uncaught_exception()? Discuss and draw conclusions.
uncaught_exception()1. What does std::uncaught_exception() do?
The standard uncaught::exception() function provides a way ...
Read now
Unlock full access