類別宣告上不允許 [attribute]
備註
必須定義類別,它才能是屬性。
如需詳細資訊,請參閱 屬性。
範例
下列範例會產生 C3454。
// C3454.cpp
// compile with: /clr /c
using namespace System;
[attribute] // C3454
ref class Attr1;
[attribute] // OK
ref class Attr2 {};
類別宣告上不允許 [attribute]
必須定義類別,它才能是屬性。
如需詳細資訊,請參閱 屬性。
下列範例會產生 C3454。
// C3454.cpp
// compile with: /clr /c
using namespace System;
[attribute] // C3454
ref class Attr1;
[attribute] // OK
ref class Attr2 {};