//Examine the elements at subscripts I through J inclusive. template inline void inner(int *p) { if (p[I + 1] < p[I]) { //if in wrong order const int temp = p[I]; //swap them p[I] = p[I + 1]; p[I + 1] = temp; } inner(p); } template <> inline void inner<0, 0>(int *p) {} //Sort N elements (subscripts 0 to N-1 inclusive). template inline void sort(int *p) { inner<0, N - 1>(p); sort(p); } template <> inline void sort<0>(int *p) {}