I know I can't create this iterator. What is not clear to me is why the try-catch block is failing to isolate the error and instead I get an assertion failure at runtime.
(note: vec1 has been properly declared and initiliazed)
Code:/* ... */ #include <stdexcept> /* ... */ try { vector<int>::const_iterator ivec = vec1.begin() - 1; } catch (runtime_error err) { cout << err.what(); }



LinkBack URL
About LinkBacks



I'm curious now as to why the assertion. My first guess is that this is a variable definition and I couldn't catch it. But moving the definition outside of the try block didn't solve the assertion. 