Compiling the following with MinGW 4.6.2 (with g++ -g -std=c++0x), gdb doesn't seem to want catch the std::out_of_range
if I try catch throw
. if I throw
it manually it catches fine, am I doing something wrong?
#include <stdexcept>
#include <vector>
int main()
{
std::vector<char> vec(10);
try {
vec.at(10); // this won't be caught by gdb
// throw std::out_of_range(""); // this will
}
catch (std::out_of_range const& e) {
}
}