diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index d71b77c..0cfafc2 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -337,27 +337,18 @@ template using mp_take = typename detail::mp_take_impl:: namespace detail { -#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 ) - template struct mp_replace_impl; template class L, class... T, class V, class W> struct mp_replace_impl, V, W> { +#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, <= 1800 ) template struct _f { using type = mp_if, W, A>; }; - using type = L::type...>; -}; - #else - -template struct mp_replace_impl -{ template using _f = mp_if, W, A>; - - using type = mp_transform<_f, L>; -}; - + using type = L<_f...>; #endif +}; } // namespace detail @@ -367,11 +358,12 @@ template using mp_replace = typename detail::mp_repla namespace detail { -template class P, class W> struct mp_replace_if_impl -{ - template using _f = mp_if, W, T>; +template class P, class W> struct mp_replace_if_impl; - using type = mp_transform<_f, L>; +template class L, class... T, template class P, class W> struct mp_replace_if_impl, P, W> +{ + template using _f = mp_if, W, U>; + using type = L<_f...>; }; } // namespace detail