From fd96b451521e1b229d1dfdf9348faecd2be9d753 Mon Sep 17 00:00:00 2001 From: Jonathan Poelen Date: Sat, 8 Nov 2025 22:27:00 +0100 Subject: [PATCH] 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 using test = mp_nth_element, I, mp_less>; using r1 = mp_transform>; ``` --- include/boost/mp11/algorithm.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index 948aacd..d4d6f56 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -679,9 +679,7 @@ template 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 using F = P; - - using part = mp_partition, F>; + using part = mp_partition_q, mp_sort_impl_f>; using L1 = mp_first; static std::size_t const N1 = mp_size::value;