Simple variadic template function can't instantinate
问题 I'm aware that sizeof...(Args...) yields the number of types in a C++0x packed template argument list, but I wanted to implement it in terms of other features for demonstation purposes, but it won't compile. // This is not a solution -- overload ambiguity. // template <typename... Args> size_t num_args (); // Line 7 // template <> constexpr size_t num_args () { return 0; } template <typename H, typename... T> constexpr size_t num_args () // Line 16 { return 1 + num_args <T...> (); // *HERE* }