Add mp_rename_v. Refs #53.

This commit is contained in:
Peter Dimov committed 2023-05-14 22:03:39 +03:00
1 parent ac1b5c96ea
commit 5186e7c294
3 files changed
+85 -1

No files matched your search

+28 -1
View File
@@ -1,7 +1,7 @@
#ifndef BOOST_MP11_LIST_HPP_INCLUDED
#define BOOST_MP11_LIST_HPP_INCLUDED
// Copyright 2015-2017 Peter Dimov.
// Copyright 2015-2023 Peter Dimov.
//
// Distributed under the Boost Software License, Version 1.0.
//
@@ -190,6 +190,33 @@ template<class L, class... T> using mp_push_back = typename detail::mp_push_back
// mp_apply_q<Q, L>
// in detail/mp_rename.hpp
// mp_rename_v<L, B>
#if defined(BOOST_MP11_HAS_TEMPLATE_AUTO)
namespace detail
{
template<class L, template<auto...> class B> struct mp_rename_v_impl
{
// An error "no type named 'type'" here means that the first argument to mp_rename_v is not a list
};
template<template<class...> class L, class... T, template<auto...> class B> struct mp_rename_v_impl<L<T...>, B>
{
using type = B<T::value...>;
};
template<template<auto...> class L, auto... A, template<auto...> class B> struct mp_rename_v_impl<L<A...>, B>
{
using type = B<A...>;
};
} // namespace detail
template<class L, template<auto...> class B> using mp_rename_v = typename detail::mp_rename_v_impl<L, B>::type;
#endif
// mp_replace_front<L, T>
namespace detail
{