Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
'var' : cannot be a literal data member
Remarks
The type of a literal attribute must be, or compile-time convertible to, one of the following types:
integral type
string
enum with an integral or underlying type
Example
The following example generates C3880:
// C3880.cpp
// compile with: /clr /c
ref struct Y1 {
literal System::Decimal staticConst1 = 10; // C3880
literal int staticConst2 = 10; // OK
};