Skip to content

sort


sort function

template <typename T, size_t N>
vec<T, N> sort(const vec<T, N> &x)

Sort the elements in the vector in ascending order
Param x input vector
Returns sorted vector

CHECK(sort(make_vector(1000, 1, 2, -10)) == make_vector(-10, 1, 2, 1000));


sortdesc function

template <typename T, size_t N>
vec<T, N> sortdesc(const vec<T, N> &x)

Sort the elements in the vector in descending order
Param x input vector
Returns sorted vector

CHECK(sort(make_vector(1000, 1, 2, -10)) == make_vector(1000, 2, 1, -10));


Auto-generated from sources, Revision 5191a48df06ea47104ca67db19fa82058d09c20a, https://github.com/kfrlib/kfr/blob/5191a48df06ea47104ca67db19fa82058d09c20a/include/kfr/