mirror of
https://github.com/boostorg/mp11.git
synced 2026-07-05 08:00:48 +02:00
optimize mp_remove_if
compiler | gcc-15 | clang-20 before | 0:00.21s - 67308K | 0:00.51s - 137744K after | 0:00.21s - 66956K | 0:00.49s - 138492K ```cpp template<class> using pred = mp_true; template<class I, class L = mp_iota<I>> using test = mp_remove_if<L, pred>; using r1 = mp_transform<test, mp_iota_c<120>>; ```
This commit is contained in:
@@ -32,8 +32,7 @@ template<template<class...> class L, class... T, template<class...> class P> str
|
||||
template<class U> struct _f { using type = mp_if<P<U>, mp_list<>, mp_list<U>>; };
|
||||
using type = mp_append<L<>, typename _f<T>::type...>;
|
||||
#else
|
||||
template<class U> using _f = mp_if<P<U>, mp_list<>, mp_list<U>>;
|
||||
using type = mp_append<L<>, _f<T>...>;
|
||||
using type = mp_append<L<>, mp_if<P<T>, mp_list<>, mp_list<T>>...>;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user