“identifier”:函数模板的显式实例化需要返回类型
注解
函数模板的显式实例化需要显式指定返回类型。 隐式返回类型指定不起作用。
Example
以下示例生成 C2909:
// C2909.cpp
// compile with: /c
template<class T> int f(T);
template f<int>(int); // C2909
template int f<int>(int); // OK
“identifier”:函数模板的显式实例化需要返回类型
函数模板的显式实例化需要显式指定返回类型。 隐式返回类型指定不起作用。
以下示例生成 C2909:
// C2909.cpp
// compile with: /c
template<class T> int f(T);
template f<int>(int); // C2909
template int f<int>(int); // OK