int main() {
vector<string> v(100, "0");
auto comp = [](const string& first, const string& second)->bool {
return first.compare(second) <= 0;
};
sort(v.begin(), v.end(), comp);
for(auto s : v) {
cout<<s<<endl;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
上面的c ++代码在g ++ v4.9.2中出现了分段错误.它是如此有线.谁知道发生了什么?