Why std::uncaught_exceptions returns int but not size_t?

Viewed 78

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:

  1. Can std::uncaught_exceptions return a negative value? If so, in which conditions is this possible?
  2. Why the biggest integer type was not chosen?
0 Answers
Related