“identifier1”:C 链接函数无法返回 C++ 类“identifier2”
注解
使用 C 链接定义的函数不能返回用户定义类型。
Example
以下示例生成 C2526:
// C2526.cpp
// compile with: /c
template <typename T>
class A {};
extern "C" A<int> func() // C2526
{
return A<int>();
}
“identifier1”:C 链接函数无法返回 C++ 类“identifier2”
使用 C 链接定义的函数不能返回用户定义类型。
以下示例生成 C2526:
// C2526.cpp
// compile with: /c
template <typename T>
class A {};
extern "C" A<int> func() // C2526
{
return A<int>();
}