編譯器錯誤 C2139
' type ' :不允許未定義的類別做為編譯器內建類型特徵 ' trait ' 的引數
不正確引數傳遞至類型特徵。
備註
如需詳細資訊,請參閱類型特徵的編譯器支援。
範例
下列範例會產生 C2139。
// C2139.cpp
// compile with: /EHsc
#include <iostream>
using namespace std;
template <class T>
struct is_polymorphic {
static const bool value = __is_polymorphic(T);
};
class C;
class D {};
class E {
public:
virtual void Test() {}
};
int main() {
cout << is_polymorphic<C>::value << endl; // C2139
cout << is_polymorphic<D>::value << endl; // OK
cout << is_polymorphic<E>::value << endl; // OK
}
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應