使用MinGW 4.6.2(使用g ++ -g -std = c ++ 0x)编译以下内容,std::out_of_range如果我尝试,gdb似乎不想捕获catch throw.如果我throw手动它抓得很好,我做错了什么?
#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) {
}
}
Run Code Online (Sandbox Code Playgroud)