I just noticed over on
http://en.cppreference.com/w/cpp/error/uncaught_exception
that C++17 will replace std::uncaught_exception()
, which returns a bool
, with std::uncaught_exceptions()
, which returns an int
.
The addition to the standard describing this is here:
http://isocpp.org/files/papers/n4259.pdf
It doesn't provide the rationale but it does say
[Note: When uncaught_exceptions() > 0, throwing an exception can
result in a call of std::terminate() (15.5.1). – end note]
which is oddly vague.
What is the reason for this change? Will multiple active exceptions be possible in C++17 or some future version of the standard?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…