xref: /freebsd/contrib/llvm-project/libcxx/src/algorithm.cpp (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
1349cc55cSDimitry Andric //===----------------------------------------------------------------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
9*81ad6265SDimitry Andric #include <algorithm>
100b57cec5SDimitry Andric 
110b57cec5SDimitry Andric _LIBCPP_BEGIN_NAMESPACE_STD
120b57cec5SDimitry Andric 
13*81ad6265SDimitry Andric // TODO(varconst): this currently doesn't benefit `ranges::sort` because it uses `ranges::less` instead of `__less`.
14*81ad6265SDimitry Andric 
150b57cec5SDimitry Andric template void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
16349cc55cSDimitry Andric #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
170b57cec5SDimitry Andric template void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
18349cc55cSDimitry Andric #endif
190b57cec5SDimitry Andric template void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
200b57cec5SDimitry Andric template void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
210b57cec5SDimitry Andric template void __sort<__less<short>&, short*>(short*, short*, __less<short>&);
220b57cec5SDimitry Andric template void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
230b57cec5SDimitry Andric template void __sort<__less<int>&, int*>(int*, int*, __less<int>&);
240b57cec5SDimitry Andric template void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
250b57cec5SDimitry Andric template void __sort<__less<long>&, long*>(long*, long*, __less<long>&);
260b57cec5SDimitry Andric template void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
270b57cec5SDimitry Andric template void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
280b57cec5SDimitry Andric template void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
290b57cec5SDimitry Andric template void __sort<__less<float>&, float*>(float*, float*, __less<float>&);
300b57cec5SDimitry Andric template void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
310b57cec5SDimitry Andric template void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
320b57cec5SDimitry Andric 
330b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&);
34349cc55cSDimitry Andric #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
350b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
36349cc55cSDimitry Andric #endif
370b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
380b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
390b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&);
400b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
410b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&);
420b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
430b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&);
440b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
450b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
460b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
470b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&);
480b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&);
490b57cec5SDimitry Andric template bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
500b57cec5SDimitry Andric 
510b57cec5SDimitry Andric template unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
520b57cec5SDimitry Andric 
530b57cec5SDimitry Andric _LIBCPP_END_NAMESPACE_STD
54