Handling zero-argument variadic template in C++11
问题 Consider the following artificial example: template <typename T, typename... Args> struct A { typedef T Type; }; Using A with 1 or more arguments works while using it with zero arguments fails as expected: error: wrong number of template arguments (0, should be 1 or more) Is it possible to make A handle the case of zero template arguments defining A::Type to int if there are no arguments and to the first template argument if there are? 回答1: First define the primary template as the most