c c++ stl
定义一个测试结构struct TestTime{ int nYear; int nMonth; int nDay; int nHour; int nMinute; int nSecond;};
编写比较时间仿函数bool CompareTime(TestTime ftime, TestTime ttime){ if(ttime.nYear != fCallLog.nYear) { return ttime.nYear < ftime.nYear; } if(ttime.nMonth != ftime.nMonth) { return ttime.nMonth < ftime.nMonth; } if(ttime.nDay != ftime.nDay) { return ttime.nDay < ftime.nDay; } if(ttime.nHour != ftime.nHour) { return ttime.nHour < ftime.nHour; } if(ttime.nMinute != ftime.nMinute) { return ttime.nMinute < ftime.nMinute; } if(ttime.nSecond != ftime.nSecond) { return ttime.nSecond < ftime.nSecond; } return false;}
排序std::list