Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
'identifier' cannot be declared with 'specifier' specifier
Remarks
A mutable specifier was used in a declaration, but the specifier is not allowed in this context.
The mutable specifier can be applied only to names of class data members, and cannot be applied to names declared const or static, and cannot be applied to reference members.
Example
The following example shows how C2178 may occur, and how to fix it.
// C2178.cpp
// compile with: cl /c /W4 C2178.cpp
class S {
mutable const int i; // C2178
// To fix, declare either const or mutable, not both.
};
mutable int x = 4; // C2178
// To fix, remove mutable keyword