用MinGW 4.6.2编译以下代码(使用g ++ -g -std = C++ 0x),gdb似乎不想要赶上std::out_of_range
如果我试着catch throw
。如果我throw
它手动捕捉罚款,我做错了什么?gdb不捕捉std :: out_of_range被向量抛出
#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) {
}
}