Bagikan melalui


Compiler Error C2139

'type' : kelas yang tidak terdefinisi tidak diizinkan sebagai argumen untuk mengkompilasi sifat jenis intrinsik 'ciri'

Keterangan

Argumen yang tidak valid diteruskan ke sifat jenis.

Untuk informasi selengkapnya, lihat Dukungan Pengkompilasi untuk Jenis Sifat.

Contoh

Contoh berikut menghasilkan 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
}