26 Aug
2004
26 Aug
'04
10:47 p.m.
On Aug 26, 2004, at 5:05 PM, David Abrahams wrote:
In question was whether an exception can be thrown from within the run_time_error's copy ctor during unwinding, and whether that would cause termination. It's no longer clear to me that such an implementation would be legal.
18.6.1 makes it clear that std::exception and all classes derived from it can not let an exception escape from their copy constructor. So if std::runtime_error's copy ctor throws, unexpected must be called, which will lead to termination. I suspect what was meant by the standard was that std::exception's copy ctor can't fail, and ditto for all classes derived from std::exception. And thus the need for a statically checked nothrow (or can't fail) spec. -Howard