| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/pythran/pythonic/builtins/list/ |
Upload File : |
#ifndef PYTHONIC_BUILTIN_LIST_SORT_HPP
#define PYTHONIC_BUILTIN_LIST_SORT_HPP
#include "pythonic/include/builtins/list/sort.hpp"
#include "pythonic/builtins/None.hpp"
#include "pythonic/types/list.hpp"
#include "pythonic/types/NoneType.hpp"
#include "pythonic/utils/functor.hpp"
#include "pythonic/utils/pdqsort.hpp"
PYTHONIC_NS_BEGIN
namespace builtins
{
namespace list
{
template <class T>
types::none_type sort(types::list<T> &seq)
{
pdqsort(seq.begin(), seq.end());
return builtins::None;
}
template <class T, class K>
types::none_type sort(types::list<T> &seq, K key)
{
pdqsort(seq.begin(), seq.end(), [&key](T const &self, T const &other) {
return key(self) < key(other);
});
return builtins::None;
}
}
}
PYTHONIC_NS_END
#endif