+inline bool operator<(const MoveStack& f, const MoveStack& s) { return f.score < s.score; }
+
+// An helper insertion sort implementation, works with pointers and iterators
+template<typename T, typename K>
+inline void sort(K firstMove, K lastMove)
+{
+ T value;
+ K cur, p, d;
+
+ if (firstMove != lastMove)
+ for (cur = firstMove + 1; cur != lastMove; cur++)
+ {
+ p = d = cur;
+ value = *p--;
+ if (*p < value)
+ {
+ do *d = *p;
+ while (--d != firstMove && *--p < value);
+ *d = value;
+ }
+ }
+}