[attribute] は非推奨とされます。System::Attribute または Platform::Metadata を基底クラスとして指定してください
注釈
[attribute] は、ユーザー定義の属性を作成するための構文として推奨されなくなりました。 詳細については、「 User-Defined Attributes」を参照してください。 CLR コードの場合は、System::Attribute から属性を派生させます。 Windows ランタイム コードの場合は、Platform::Metadata から属性を派生させます。
例
次の例では、C4580 を生成し、その修正方法を示します。
// C4580.cpp
// compile with: /W3 /c /clr
[attribute] // C4580
public ref class Attr {
public:
int m_t;
};
public ref class Attr2 : System::Attribute {
public:
int m_t;
};