1
的VisualStudio不能编译这个代码(错误C2976)VS2015错误C2976
但GCC和锵可以编译该代码
为什么???
#include <iostream>
#include <map>
template <typename... ARGS>
void Func(const std::map<ARGS...>& m)
{
//...
}
template <typename T>
void Func(const T& t)
{
//...
}
int main()
{
std::map<int, double> m;
Func(m); // error C2976: 'std::map': too few template arguments
Func(123); // OK
return 0;
}
它显示任何错误? –
[std:map作为模板参数的模板扣除失败]的可能重复(http://stackoverflow.com/questions/26059219/template-deduction-fails-for-stdmap-as-template-parameter) – cromod