#ifndef _ALGORITHM_INCLUDED #define _ALGORITHM_INCLUDED #include #include namespace std { static bool (*__cmpfn)(const void* elem1, const void* elem2); static int __compare(const void* elem1, const void* elem2) {return __cmpfn(elem1,elem2)?-1:1;} template void sort(T* first, T* last, Pred pr) { __cmpfn=(bool(*)(const void*,const void*))pr; qsort(first,last-first,sizeof(*first),&__compare); } } #endif