Because std::uncaught_exceptions returns count of exceptions that have been thrown, it makes no sense to have this number negative. Also, size_t may be bigger than int and thus it is less likely to be overflown.
So I have 2 questions:
- Can
std::uncaught_exceptionsreturn a negative value? If so, in which conditions is this possible? - Why the biggest integer type was not chosen?