次の方法で共有


RequiredAttributeAttribute クラス

インポート元のコンパイラが、型定義のセマンティクスを十分に理解している必要があるか、またはその使用を拒否する必要があることを示します。

この型のすべてのメンバの一覧については、RequiredAttributeAttribute メンバ を参照してください。

System.Object
   System.Attribute
      System.Runtime.CompilerServices.RequiredAttributeAttribute

<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Struct _
   Or AttributeTargets.Enum Or AttributeTargets.Interface)>
<Serializable>
NotInheritable Public Class RequiredAttributeAttribute   Inherits Attribute
[C#]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
   AttributeTargets.Enum | AttributeTargets.Interface)]
[Serializable]
public sealed class RequiredAttributeAttribute : Attribute
[C++]
[AttributeUsage(AttributeTargets::Class | AttributeTargets::Struct
   | AttributeTargets::Enum | AttributeTargets::Interface)]
[Serializable]
public __gc __sealed class RequiredAttributeAttribute : public   Attribute
[JScript]
public
   AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
   AttributeTargets.Enum | AttributeTargets.Interface)
 Serializable
class RequiredAttributeAttribute extends Attribute

スレッドセーフ

この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。

解説

この属性は、クラス、構造体、列挙体、およびインターフェイスに適用できます。

たとえば、この属性を使用して、コピー コンストラクタを持つ C++ クラスをマークできます。このようなクラスを使用するコンパイラは、そのクラスの使用に関するあらゆる制約を理解している必要があります。たとえば、そのようなクラスのオブジェクトのコピー コンストラクタは再配置によっては呼び出されないため、そのようなオブジェクトはガベージ コレクションが行われるヒープ内では作成しません。

System.Runtime.CompilerServices のクラスはコンパイラ ライタ専用です。

必要条件

名前空間: System.Runtime.CompilerServices

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

アセンブリ: Mscorlib (Mscorlib.dll 内)

参照

RequiredAttributeAttribute メンバ | System.Runtime.CompilerServices 名前空間