1
0
forked from boostorg/mp11

Add value list support to mp_at. Refs #53.

This commit is contained in:
Peter Dimov
2023-05-16 19:13:56 +03:00
parent 799c2e6079
commit 73626ba3bc
3 changed files with 75 additions and 1 deletions

View File

@@ -352,11 +352,20 @@ template<template<class...> class L, class... T, std::size_t I> struct mp_at_c_i
using type = __type_pack_element<I, T...>;
};
#if defined(BOOST_MP11_HAS_TEMPLATE_AUTO)
template<template<auto...> class L, auto... A, std::size_t I> struct mp_at_c_impl<L<A...>, I>
{
using type = __type_pack_element<I, mp_value<A>...>;
};
#endif
#else
template<class L, std::size_t I> struct mp_at_c_impl
{
using _map = mp_transform<mp_list, mp_iota<mp_size<L> >, L>;
using _map = mp_transform<mp_list, mp_iota<mp_size<L> >, mp_rename<L, mp_list>>;
using type = mp_second<mp_map_find<_map, mp_size_t<I> > >;
};