optimize mp_nth_element

compiler | gcc-15 | clang-20
before   | 0:00.66s - 206316K | 0:01.77s - 246832K
after    | 0:00.63s - 192944K | 0:01.76s - 245956K

```cpp
template<class I> using test = mp_nth_element<mp_iota_c<I::value+1>, I, mp_less>;

using r1 = mp_transform<test, mp_iota_c<30>>;
```
This commit is contained in:
Jonathan Poelen
2025-11-08 22:27:00 +01:00
parent 51c1366dd8
commit fd96b45152
+1 -3
View File
@@ -679,9 +679,7 @@ template<template<class...> class L, class T1, class... T, std::size_t I, templa
{
static_assert( I < 1 + sizeof...(T), "mp_nth_element index out of range" );
template<class U> using F = P<U, T1>;
using part = mp_partition<L<T...>, F>;
using part = mp_partition_q<L<T...>, mp_sort_impl_f<T1, P>>;
using L1 = mp_first<part>;
static std::size_t const N1 = mp_size<L1>::value;