natknąłem się na ten wielki artykuł: http://pdimov.com/cpp2/simple_cxx11_metaprogramming.htmlo zmiennej liczbie argumentów szablony typu odliczenie
W poniższym kodzie:
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;
//...
mp_rename<mp_list<int, float, void*>, std::tuple>; // -> std::tuple<int, float, void*>
// T... will be deduced as int, float, void*
Dlaczego C jest wyprowadzany jako mp_list (zamiast mp_list < int, float , void *>) i T ... jako int, float, void *?
myślę Sztuką jest częścią szablonu specjalność: struct mp_rename_impl < C < T ...> B>, Ale ja usiłuję zrozumieć dlaczego
Które "A"? 'class A' lub' template klasa A'? –
Jarod42
Zmieniłem nazwę na C, tak jak uczyniłeś to, aby było jaśniejsze. –