Unhandled exceptions (throw with no try)
I was under the impression that defining a throw, for instance on a class constructor, and then forcing an exception without a try-catch block would cause an unhandled exception. It would also cause an unhandled exception if I used the try block but the catch clauses didn't catch the specific error.
However, on a simple test I did, my application exits and only outputs a message to the console, not generating an unhandled exception and consequently not firing my JIT debugger.
This is my simple test:
Code:
#include <cstdlib>
#include <stdexcept>
class Range {
public:
explicit Range(const int i): sInt_(i) {
if(i < 0 || i > 255)
sInt_ = 0;
throw std::out_of_range("Invalid small integer. Out of range.");
}
operator int() const { return sInt_; }
private:
size_t sInt_;
};
int main() {
Range si(-4);
return EXIT_SUCCESS;
}
Attached is my console output. Drmingw (the JITD I'm using) didn't fire.
What gives?