diff --git a/include/boost/mp11/detail/mp_rename.hpp b/include/boost/mp11/detail/mp_rename.hpp new file mode 100644 index 0000000..d05f6f7 --- /dev/null +++ b/include/boost/mp11/detail/mp_rename.hpp @@ -0,0 +1,43 @@ +#ifndef BOOST_MP11_DETAIL_MP_RENAME_HPP_INCLUDED +#define BOOST_MP11_DETAIL_MP_RENAME_HPP_INCLUDED + +// Copyright 2015-2021 Peter Dimov. +// +// Distributed under the Boost Software License, Version 1.0. +// +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +#include + +namespace boost +{ +namespace mp11 +{ + +// mp_rename +namespace detail +{ + +template class B> struct mp_rename_impl +{ +// An error "no type named 'type'" here means that the first argument to mp_rename is not a list +}; + +template class A, class... T, template class B> struct mp_rename_impl, B> +{ + using type = B; +}; + +} // namespace detail + +template class B> using mp_rename = typename detail::mp_rename_impl::type; + +template class F, class L> using mp_apply = typename detail::mp_rename_impl::type; + +template using mp_apply_q = typename detail::mp_rename_impl::type; + +} // namespace mp11 +} // namespace boost + +#endif // #ifndef BOOST_MP11_DETAIL_MP_RENAME_HPP_INCLUDED diff --git a/include/boost/mp11/list.hpp b/include/boost/mp11/list.hpp index 6ab12dd..6572a62 100644 --- a/include/boost/mp11/list.hpp +++ b/include/boost/mp11/list.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -169,26 +170,9 @@ template class L, class... U, class... T> struct mp_push_back template using mp_push_back = typename detail::mp_push_back_impl::type; // mp_rename -namespace detail -{ - -template class B> struct mp_rename_impl -{ -// An error "no type named 'type'" here means that the first argument to mp_rename is not a list -}; - -template class A, class... T, template class B> struct mp_rename_impl, B> -{ - using type = B; -}; - -} // namespace detail - -template class B> using mp_rename = typename detail::mp_rename_impl::type; - -template class F, class L> using mp_apply = typename detail::mp_rename_impl::type; - -template using mp_apply_q = typename detail::mp_rename_impl::type; +// mp_apply +// mp_apply_q +// in detail/mp_rename.hpp // mp_replace_front namespace detail