Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:46:51

0001 #ifndef BOOST_MP11_DETAIL_MP_RENAME_HPP_INCLUDED
0002 #define BOOST_MP11_DETAIL_MP_RENAME_HPP_INCLUDED
0003 
0004 //  Copyright 2015-2023 Peter Dimov.
0005 //
0006 //  Distributed under the Boost Software License, Version 1.0.
0007 //
0008 //  See accompanying file LICENSE_1_0.txt or copy at
0009 //  http://www.boost.org/LICENSE_1_0.txt
0010 
0011 #include <boost/mp11/detail/mp_defer.hpp>
0012 #include <boost/mp11/detail/mp_value.hpp>
0013 #include <boost/mp11/detail/config.hpp>
0014 
0015 namespace boost
0016 {
0017 namespace mp11
0018 {
0019 
0020 // mp_rename<L, B>
0021 namespace detail
0022 {
0023 
0024 template<class L, template<class...> class B> struct mp_rename_impl
0025 {
0026 // An error "no type named 'type'" here means that the first argument to mp_rename is not a list
0027 };
0028 
0029 template<template<class...> class L, class... T, template<class...> class B> struct mp_rename_impl<L<T...>, B>: mp_defer<B, T...>
0030 {
0031 };
0032 
0033 #if defined(BOOST_MP11_HAS_TEMPLATE_AUTO)
0034 
0035 template<template<auto...> class L, auto... A, template<class...> class B> struct mp_rename_impl<L<A...>, B>: mp_defer<B, mp_value<A>...>
0036 {
0037 };
0038 
0039 #endif
0040 
0041 } // namespace detail
0042 
0043 template<class L, template<class...> class B> using mp_rename = typename detail::mp_rename_impl<L, B>::type;
0044 
0045 // mp_apply<F, L>
0046 template<template<class...> class F, class L> using mp_apply = typename detail::mp_rename_impl<L, F>::type;
0047 
0048 // mp_apply_q<Q, L>
0049 template<class Q, class L> using mp_apply_q = typename detail::mp_rename_impl<L, Q::template fn>::type;
0050 
0051 } // namespace mp11
0052 } // namespace boost
0053 
0054 #endif // #ifndef BOOST_MP11_DETAIL_MP_RENAME_HPP_INCLUDED