【发布时间】:2014-05-30 08:47:47
【问题描述】:
我正在尝试对list<CMail> 进行排序(其中 CMail 是某个对象,对于这个问题的目的并不重要)。现在,我想整理一下。
我知道 list 有一个 sort() 函数,它要么使用标准 operator
我的功能
bool comp( const CMail & x ) const;
返回,如果我们考虑 a.comp(b); , 如果 a
现在,我想使用这个排序功能,我正在使用
temp.sort( CMail::comp );
其中 temp 是一个
list<CMail> temp;
但是,编译器不让我说
错误:非静态成员函数'bool CMail::comp(const CMail&) const'的使用无效
有人知道问题出在哪里吗?在此先感谢:)
【问题讨论】: