Fixed number of template arguments from a variadic template
c++, c++11, templates, variadic-templates
Solution
template <template <typename> class F> struct call_me {};
template <typename T> struct maybe;
template <typename... T> struct more;
template <template <class...> class F> struct just_one {
template <class A> using tmpl = F<A>;
};
int main()
{
call_me<maybe> a;
call_me<just_one<more>::tmpl> b;
}
Not exactly equivalent, but maybe close enough.
Problem
``` template <template <typename> class F> struct call_me {}; template <typename T> struct maybe; template <typename... T> struct more; int main() { call_me<maybe> a; // ok call_me<more> b; // error } ``` I understand why `call_me<more>` fails. But I want to make it work. Is there a workaround that doesn't involve changing `call_me` (or add an specialization to it)?