当 std::sort 中的比较函数总是返回 true 时,为什么会出现运行时错误?
bool compare(string a, string b)
{
return true;
}
vector<string> Test;
for (int i = 0; i < 7; i++)
Test.push_back(string("0"));
sort(Test.begin(), Test.end(), compare);
最佳答案
关于c++ - 当 std::sort 中的比较函数总是返回 true 时,为什么会出现运行时错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41488093/