10template <
typename Iterator,
typename Compare>
11inline void InsertionSort(Iterator inBegin, Iterator inEnd, Compare inCompare)
17 for (Iterator i = inBegin + 1; i != inEnd; ++i)
20 auto x = std::move(*i);
23 if (inCompare(x, *inBegin))
27 for (Iterator j = i; j != inBegin; j = prev)
34 *inBegin = std::move(x);
40 for (Iterator prev = j - 1; inCompare(x, *prev); j = prev, --prev)
41 *j = std::move(*prev);
51template <
typename Iterator>
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
JPH_NAMESPACE_BEGIN void InsertionSort(Iterator inBegin, Iterator inEnd, Compare inCompare)
Implementation of the insertion sort algorithm.
Definition: InsertionSort.h:11