Skip to content

Commit 09cb423

Browse files
authored
Add code style, comment
@MugBergerFries It's a good idea to use code styling for mentions of variable or class names (especially when they're easily confused generic names like "value"). I also added a comment to the fixed code sample to amplify the change and what it was doing.
1 parent 8408a54 commit 09cb423

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/code-quality/c26495.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Code analysis name: MEMBER_UNINIT
1818

1919
## Example
2020

21-
The following code generates this warning. This issue stems from the member variable 'value' not being initialized when a MyStruct object is created.
21+
The following sample generates warning C26495 because the member variable `value` isn't initialized when a `MyStruct` object is created.
2222

2323
```cpp
2424
struct MyStruct
@@ -33,7 +33,7 @@ To resolve the issue, you can add in-class initialization to all of the member v
3333
```cpp
3434
struct MyStruct
3535
{
36-
int value{};
36+
int value{}; // empty brace initializer sets value to 0
3737
MyStruct() {} // no warning, MyStruct::value is set via default member initialization
3838
};
3939
```

0 commit comments

Comments
 (0)