Compilerfehler C2139
'type' : Eine nicht definierte Klasse ist nicht als Argument für den systeminternen Compilertyp "trait" zulässig.
Ein ungültiges Argument wurde an eine Typeigenschaft übergeben.
Hinweise
Weitere Informationen finden Sie unter Compilerunterstützung für Typmerkmale.
Beispiel
Im folgenden Beispiel wird C2139 generiert.
// 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
}