hsort_arrayはヒープソートアルゴリズムの実装です。operator []インターフェースのような配列を持つものはすべてソートされます。 

#include <dlib / sort.h>

    template <
        typename T,
        typename compare
    void hsort_array (
        T& array,
        unsigned long left,
        unsigned long right,
        const compare& comp 
            - T implements operator[]                                 
            - the items in array must be comparable by comp where comp is a function
              object with the same syntax as std::less<>
            - the items in array must be swappable by a global swap()   
            - left and right are within the bounds of array
              i.e. array[left] and array[right] are valid elements
            - left <= right
            - for all elements in #array between and including left and right the 
              ith element is < the i+1 element
            - sorts using a heapsort algorithm

Posted by kinya