正如标题,我在《C++标准库(第二版)》中看到运行下面代码会显示Runtime Error:
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> v;
v.pop_back();//没有东西,应该RE
if (!v.empty()) v.pop_back();
cout << "I'm not Runtime Error!" << endl;
return 0;
}
书上差不多和这个一样,但是在运行后,却输出了
I'm not Runtime Error!
这说明其实没有RE,至少在dev-c++中用的g++编译器是这样