如何用sort()对结构体进行排序:
如:
 #include <list>
 using namespace std;
  typedef struct TaskTable {
        int ID;
        int sum;
            CTime curTime;
    }   TaskTableType;
typedef list<TaskTableType> TaskQueue;
TaskQueue curQ;
我想通过void sort(RanIt first, RanIt last, Pred pr);比较结构体中的ID的大小来对curQ进行排序。但不知道比较函数怎么写!请较大虾!如何使用?最好能保我写个例程!
谢谢先~~