C26495 MEMBER_UNINIT
Variable '%variable%' is uninitialized. Always initialize a member variable (type.6).
See also
C++ Core Guidelines Type.6 and C.48
Example
struct MyStruct
{
int value;
MyStruct() {}; // C26495, MyStruct::value is uninitialized
};
To fix the warning, add in-class initializers to all of the member variables. See the above linked C++ Core Guidelines pages for additional information.
struct MyStruct
{
int value{};
MyStruct() {}; // no warning, MyStruct::value is set via default member initialization
};
Povratne informacije
Pošalјite i prikažite povratne informacije za