共用方式為


編譯器錯誤 C2526

'identifier1' : C 連結函式無法傳回類別 'identifier2' C++

備註

使用 C 連結定義的函式無法傳回使用者定義型別。

Example

下列範例會產生 C2526:

// C2526.cpp
// compile with: /c
template <typename T>
class A {};

extern "C" A<int> func()   // C2526
{
    return A<int>();
}