I came across this wonderful article: http://pdimov.com/cpp2/simple_cxx11_metaprogramming.html
In the following code:
template<class A, template<class...> class B> struct mp_rename_impl; template<template<class...> class C, class... T, template<class...> class B> struct mp_rename_impl<C<T...>, B> { using type = B<T...>; }; template<class A, template<class...> class B> using mp_rename = typename mp_rename_impl<A, B>::type;
Why is C output as mp_list (instead of mp_list <int, float, void *> ) and T ... as int, float, void * ?
I think the trick is part of the template specialization: struct mp_rename_impl <C <T ...>, B> , but I can't understand why
source share