使用std:sort遇到难题解决办法

使用std::sort遇到难题
好的,首先,这是我的成员函数,这个成员函数可以取代oprater> 重载,会读取到许多private变量
bool   smsOP::time_compare(const   sms_elem   &   p1,const   sms_elem   &   p2)
{
date   d1,d2;

d1   =   processTime(p1);
d2   =   processTime(p2);

if   (d1.year   >   d2.year)
return   true;
else  
if   (d1.month   >   d2.month)
return   true;
else
if   (d1.day   >   d2.day)
return   true;
else
if   (d1.hour   >   d2.hour)
return   true;
else
if   (d1.min   >   d2.min)
return   true;
else
if   (d1.sec   >   d2.sec)
return   true;
else
return   false;
}
好的,这个函数通过测试。我在另外一个函数中调用,比如,这样调用
sort(read_in.begin(),read_in.end(),time_compare);
好,立马编译报错:
j:\md\visual   studio   2005\projects\smswork\smswork\smsop.cpp(122)   :   error   C3867:   'smsOP::time_compare ':   function   call   missing   argument   list;   use   '&smsOP::time_compare '   to   create   a   pointer   to   member
j:\md\visual   studio   2005\projects\smswork\smswork\smsop.cpp(122)   :   error   C2780:   'void   std::sort(_RanIt,_RanIt) '   :   expects   2   arguments   -   3   provided
                d:\program   files\microsoft   visual   studio   8\vc\include\algorithm(3109)   :   see   declaration   of   'std::sort '

好的,改,改成这个这个样子:
sort(read_in.begin(),read_in.end(),&smsOP::time_compare);

继续报错:
d:\program   files\microsoft   visual   studio   8\vc\include\algorithm(3181)   :   error   C2064:   term   does   not   evaluate   to   a   function   taking   2   arguments
                d:\program   files\microsoft   visual   studio   8\vc\include\algorithm(3237)   :   see   reference   to   function   template   instantiation   'std::pair <_Ty1,_Ty2>   std::_Unguarded_partition <_RanIt,_Pr> (_RanIt,_RanIt,_Pr) '   being   compiled
                with
                [
                        _Ty1=std::_Vector_iterator <sms_elem,std::allocator <sms_elem> > ,
                        _Ty2=std::_Vector_iterator <sms_elem,std::allocator <sms_elem> > ,
                        _RanIt=std::_Vector_iterator <sms_elem,std::allocator <sms_elem> > ,
                        _Pr=bool   (__thiscall   smsOP::*   )(const   sms_elem   &,const   sms_elem   &)
                ]
                d:\program   files\microsoft   visual   studio   8\vc\include\algorithm(3261)   :   see   reference   to   function   template   instantiation   'void   std::_Sort <std::_Vector_iterator <_Ty,_Alloc> ,__w64   int,_Pr> (_RanIt,_RanIt,_Diff,_Pr) '   being   compiled