包含描述 Type 泛型类型的参数的值,如对 IMetaDataEmit2::D efineGenericParam 的调用中使用的。
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 |
参数差异仅适用于接口和委托的泛型参数。 |
gpNonVariant |
指示缺少方差。 |
gpCovariant |
Indicates covariance. |
gpContravariant |
Indicates contravariance. |
gpSpecialConstraintMask |
特殊约束可以应用于任何 Type 参数。 |
gpNoSpecialConstraint |
指示任何约束都不适用于 Type 参数。 |
gpReferenceTypeConstraint |
指示 Type 参数必须是引用类型。 |
gpNotNullableValueTypeConstraint |
指示 Type 参数必须是不能为 null 值的值类型。 |
gpDefaultConstructorConstraint |
指示 Type 参数必须具有不采用任何参数的默认公共构造函数。 |
gpAllowByRefLike |
指示 Type 参数可以是 类似 byref 的类型。 (自 .NET 7 起可用)。 |
Requirements
平台: 请参阅 .NET 支持的作系统。
Header: CorHdr.h
.NET 版本: 自 .NET Framework 2.0 起可用