请教,为什么不能编译通过?
#include<list>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
class Entry{
public:
string name;
int number;
Entry(const string& a, int b):name(a), number(b){}
};
int main()
{
vector<Entry> ve;
ve.push_back(Entry("xhl",123456));
ve.push_back(Entry("chen",654321));
sort(ve.begin(),ve.end());
return 0;
}
sort函数为什么会出错?而且都是algorithm头文件里出错,请高手指教.