Condividi tramite


Errore del compilatore C2139

'type': una classe non definita non è consentita come argomento per il tratto intrinseco del tipo del compilatore 'trait'

Un argomento non valido è stato passato a un tratto di tipo.

Osservazioni:

Per altre informazioni, vedere Supporto del compilatore per caratteristiche di tipo.

Esempio

L'esempio seguente genera l'errore 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
}