Compare.h

Classes

Global Functions -- signature of comparison functions (full description)
ObjCompare -- compare two objects (full description)

signature of comparison functions (source)

Interface

typedef int ObjCompareFunc (const void*, const void*)

Description

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1995/02/24

Synopsis

This typedef defines the signature of the comparison functions used in, for instance, the Sort class: functions with two const void* arguments returning an int value. One such function is defined in the ObjCompare class.

Member Description

typedef int ObjCompareFunc (const void*, const void*)


template<class T> class ObjCompare

Interface

Public Members
static int compare (const void* obj1, const void* obj2)

Description

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1995/02/24

Synopsis

The templated class ObjCompare<T> really is only a place holder for the static function compare which compares two objects of type T.

Template Type Argument Requirements (T)

Member Description

static int compare (const void* obj1, const void* obj2)

Compare two objects, and return The function is not inlined allowing one to take the address of it. Furthermore, the function's signature agrees with ObjCompareFunc so that it can be used in the Sort class.