Why does this design not work?
Visual Studio shows error C3201: the list of template parameters for the template template "AA" does not match the list of template parameters for the template parameter "C". But in both cases it looks like <int, char, bool>
.
template<int I, char C, bool B> struct AA { static const int i = I; static const char c = C; static const bool b = B; }; template<typename... T> struct outer { template <template<T... > typename C> struct inner { template<T... X> using type = C<X...>; }; }; static_assert(outer<int, char, bool>::inner<AA>::type<5, 'a', true>::i == 5, "???");
ADDED: Also, the compiler cannot call types in specializations, such as
template<class T, template<T> class C, T X> struct A<C<X>> { ... };
Are such tricks forbidden by the standard or are these just compiler restrictions?
source share