|
Quark
0.1
|
A collection of general-purpose algorithms. More...
#include <Algorithms.h++>
Static Public Member Functions | |
| template<typename ITER , typename T , typename LESSTHAN > | |
| static int | orderedInsertPosition (ITER begin, ITER end, const T &item, LESSTHAN lessThan=defaultLessThan) |
| Returns the insert position for an item in a (presumably sorted) collection. More... | |
A collection of general-purpose algorithms.
|
inlinestatic |
Returns the insert position for an item in a (presumably sorted) collection.
This method performs a binary search to determine where to insert the new element such that the sort order of the collection is preserved.
| T | The type of the items in the collection. |
| begin | An iterator pointing to the beginning of the collection. |
| end | An iterator pointing to the end of the collection. |
| item | The item to insert into the collection. |
| lessThan | A function that implements the less-than operation for items of type T. |