mirror of
https://github.com/boostorg/mp11.git
synced 2026-07-05 08:00:48 +02:00
optimize mp_map_replace
compiler | gcc-15 | clang-20 before | 0:00.39s - 114524K | 0:00.66s - 155888K after | 0:00.38s - 114140K | 0:00.64s - 155184K ```cpp template<class I, class L = mp_transform<mp_list, mp_iota<I>>> using test = mp_map_replace<L, mp_list<I,I>>; using r1 = mp_transform<test, mp_iota_c<120>>; ```
This commit is contained in:
@@ -46,9 +46,7 @@ template<template<class...> class M, class... U, class T> struct mp_map_replace_
|
||||
|
||||
#else
|
||||
|
||||
template<class V> using _f = mp_if< std::is_same<mp_first<V>, K>, T, V >;
|
||||
|
||||
using type = mp_if< mp_map_contains<M<U...>, K>, M<_f<U>...>, M<U..., T> >;
|
||||
using type = mp_if< mp_map_contains<M<U...>, K>, M<mp_if< std::is_same<mp_first<U>, K>, T, U >...>, M<U..., T> >;
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user