型定義を破棄できるものとしてマークします。
この型のすべてのメンバの一覧については、DiscardableAttribute メンバ を参照してください。
System.Object
System.Attribute
System.Runtime.CompilerServices.DiscardableAttribute
Public Class DiscardableAttribute
Inherits Attribute
[C#]
public class DiscardableAttribute : Attribute
[C++]
public __gc class DiscardableAttribute : public Attribute
[JScript]
public class DiscardableAttribute extends Attribute
スレッドセーフ
この型の public static (Visual Basicでは Shared) のすべてのメンバは、マルチスレッド操作で安全に使用できます。インスタンスのメンバの場合は、スレッドセーフであるとは限りません。
解説
アセンブリ内の他のコードによって参照されていない型定義は、破棄できるものとしてマークできます。これは、型が実際に他のコードによって参照されているかどうかがリンク フェーズでだけ確認される分離コンパイルをサポートしている言語で役に立つことがあります。
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 内)
参照
DiscardableAttribute メンバ | System.Runtime.CompilerServices 名前空間