หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Contains values that describe the Type parameters for generic types, as used in calls to IMetaDataEmit2::DefineGenericParam.
Syntax
typedef enum CorGenericParamAttr {
gpVarianceMask = 0x0003,
gpNonVariant = 0x0000,
gpCovariant = 0x0001,
gpContravariant = 0x0002,
gpSpecialConstraintMask = 0x001C,
gpNoSpecialConstraint = 0x0000,
gpReferenceTypeConstraint = 0x0004,
gpNotNullableValueTypeConstraint = 0x0008,
gpDefaultConstructorConstraint = 0x0010,
gpAllowByRefLike = 0x0020,
} CorGenericParamAttr;
Members
| Member | Description |
|---|---|
gpVarianceMask |
Parameter variance applies only to generic parameters for interfaces and delegates. |
gpNonVariant |
Indicates the absence of variance. |
gpCovariant |
Indicates covariance. |
gpContravariant |
Indicates contravariance. |
gpSpecialConstraintMask |
Special constraints can apply to any Type parameter. |
gpNoSpecialConstraint |
Indicates that no constraint applies to the Type parameter. |
gpReferenceTypeConstraint |
Indicates that the Type parameter must be a reference type. |
gpNotNullableValueTypeConstraint |
Indicates that the Type parameter must be a value type that cannot be a null value. |
gpDefaultConstructorConstraint |
Indicates that the Type parameter must have a default public constructor that takes no parameters. |
gpAllowByRefLike |
Indicates that the Type parameter can be a byref-like type. (Available since .NET 7.) |
Requirements
Platforms: See .NET supported operating systems.
Header: CorHdr.h
.NET versions: Available since .NET Framework 2.0
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา