diff --git a/headers/private/shared/ObjectList.h b/headers/private/shared/ObjectList.h index 04a59bf1a3..a4655d09cc 100644 --- a/headers/private/shared/ObjectList.h +++ b/headers/private/shared/ObjectList.h @@ -207,6 +207,10 @@ public: int32 BinarySearchIndex(const T &item, CompareFunctionWithState compare, void *state) const; + template + int32 BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const; + // Binary insertion - list must be sorted with CompareFunction for // these to work @@ -693,6 +697,17 @@ BObjectList::BinarySearchIndex(const T &item, } +template +template +int32 +BObjectList::BinarySearchIndexByKey(const Key &key, + int (*compare)(const Key *, const T *)) const +{ + return _PointerList_::BinarySearchIndex(&key, + (GenericCompareFunction)compare); +} + + template bool BObjectList::BinaryInsert(T *item, CompareFunction func)