mirror of
https://github.com/boostorg/mp11.git
synced 2026-07-05 08:00:48 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user