Example #1
0
void scolarships::students::List::Sort( int (*CmpFunc)(Student *, Student *) )
{
    for(int i = 1; i < studentCount ; i++)
    {
        Student * student = studentList[i];
        int j = i - 1;
        while (j >= 0 && CmpFunc(studentList[j], student) > 0)
        {
            studentList[j + 1] = studentList[j];
            j--;
        }
        studentList[j + 1] = student;
    }
}
Example #2
0
CmpResult TypeComparer::operator () (TypeNode *a,TypeNode *b) const
 {
  if( !level ) GuardMapTooDeep();

  return TypeAdapter::Binary<CmpRet>(a,b,CmpFunc(eval,level-1)).result;
 }