नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'type' : a type that is dependent on a generic type parameter is not allowed as an argument to compiler intrinsic type trait 'trait'
Remarks
An invalid type specifier was passed to a type trait.
For more information, see Compiler Support for Type Traits.
Example
The following example generates C2140.
// C2140.cpp
// compile with: /clr /c
template <class T>
struct is_polymorphic {
static const bool value = __is_polymorphic(T);
};
class x {};
generic <class T>
ref class C {
void f() {
System::Console::WriteLine(__is_polymorphic(T)); // C2140
System::Console::WriteLine(is_polymorphic<T>::value); // C2140
System::Console::WriteLine(__is_polymorphic(x)); // OK
System::Console::WriteLine(is_polymorphic<x>::value); // OK
}
};