Muistiinpano
Tälle sivulle pääsy edellyttää valtuutusta. Voit yrittää kirjautua sisään tai vaihtaa hakemistoja.
Tälle sivulle pääsy edellyttää valtuutusta. Voit yrittää vaihtaa hakemistoja.
illegal expression for named attribute argument 'field'
Remarks
When initializing a named attribute argument, the value must be a compile time constant.
For more information on attributes, see User-Defined Attributes.
Example
The following example generates C3101.
// C3101.cpp
// compile with: /clr /c
ref class AAttribute : System::Attribute {
public:
int Field;
};
extern int i;
[assembly:A(Field = i)]; // C3101
[assembly:A(Field = 0)]; // OK