diff --git a/include/boost/mp11/algorithm.hpp b/include/boost/mp11/algorithm.hpp index c04143e..e69bbaf 100644 --- a/include/boost/mp11/algorithm.hpp +++ b/include/boost/mp11/algorithm.hpp @@ -1111,28 +1111,12 @@ template using canonical_left_rotation = mp_size_ // perform right rotation as a left rotation by inverting the number of elements to rotate template using canonical_right_rotation = mp_size_t; -struct left_rotation; - -template struct mp_rotate_impl -{ -// An error "no type named 'type'" here means that the first argument to mp_rotate_left/mp_rotate_right is not a list -}; - -template class L, class... T> struct mp_rotate_impl, mp_size_t<0>, left_rotation> -{ - // fast-track the case of an identity rotation - using type = L; -}; - -template class L, class... T, std::size_t N> struct mp_rotate_impl, mp_size_t, left_rotation> -{ - // avoid errors when rotating fixed-sized lists by using mp_list for the transformation - using type = mp_rename, N>, mp_take_c, N>>, L>; -}; +// avoid errors when rotating fixed-sized lists by using mp_list for the transformation +template> using mp_rotate_impl = mp_assign, mp_take >>; } // namespace detail -template using mp_rotate_left_c = typename detail::mp_rotate_impl::value, N>, detail::left_rotation>::type; +template using mp_rotate_left_c = detail::mp_rotate_impl::value, N>>; template using mp_rotate_left = mp_rotate_left_c; // mp_rotate_right(_c)