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.