The question is almost meaningless without an example. So here is what I am trying to do.
In general, C ++ allows the following:
template<class T, class U, T t, U u> void func() {} func<char, int, 'A', 10>();
But it seems that its natural variational extension does not work.
template<class...T, T... t> void func() {} func<char, int, 'A', 10>();
Both clang and g ++ 4.7 reject the above code. An error is displayed where the instance is being created. It seems to me that two variational lists should be analyzed unambiguously, because the first has types, and the other has only integral values.
If the above is not intended to work, I think the following will not work.
template <class Ret, class... Args, Ret (*func)(Args...)> class Foo {};
I think the Foo pattern is a pretty useful thing.
c ++ c ++ 11 variadic-templates
Sumant
source share