-/// Our insertion sort implementation, works with pointers and iterators and is
-/// guaranteed to be stable, as is needed.
-template<typename T, typename K>
-void sort(K first, K last)
-{
- T tmp;
- K p, q;
-
- for (p = first + 1; p < last; p++)
- {
- tmp = *p;
- for (q = p; q != first && *(q-1) < tmp; --q)
- *q = *(q-1);
- *q = tmp;
- }
-}
-