Skip to content

Commit ce3b069

Browse files
TylerMSFTTylerMSFT
authored andcommitted
prepare for review
1 parent 4d0a6a7 commit ce3b069

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

docs/ide/lnt-make-member-function-const.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: make-member-function-const
3-
description: "Reference for Visual Studio C++ IntelliSense Linter check make-member-function-const."
4-
ms.date: 09/27/2023
5-
f1_keywords: ["make-member-function-const"]
6-
helpviewer_keywords: ["make-member-function-const"]
2+
title: lnt-make-member-function-const
3+
description: "Reference for Visual Studio C++ IntelliSense Linter check lnt-make-member-function-const."
4+
ms.date: 09/28/2023
5+
f1_keywords: ["lnt-make-member-function-const"]
6+
helpviewer_keywords: ["lnt-make-member-function-const"]
77
monikerRange: ">=msvc-170"
88
---
9-
# `make-member-function-const`
9+
# `lnt-make-member-function-const`
1010

1111
When member functions don’t modify the object's state, annotate them with the `const` keyword. This guidance comes from the [C++ Core Guideline Con.2](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#con2-by-default-make-member-functions-const).
1212

@@ -33,7 +33,7 @@ double getRadius()
3333

3434
## How to fix the issue
3535

36-
The solution proposed by the linter is to mark member functions `const` when they don't modify the object's state. This let's both developers and the compiler know that the function is safe to call on a `const` object.
36+
Mark member functions `const` when they don't modify the object's state. This lets both developers and the compiler know that the function is safe to call on a `const` object.
3737

3838
In the following example, `const` has been added to `getValue()` and `getRadius()`:
3939

@@ -59,15 +59,15 @@ double getRadius() const // added const
5959

6060
The editor can make this change for you. Place the cursor on the flagged symbol and choose **Show potential fixes** and then **Make member const**:
6161

62-
:::image type="complex" source="media/make-member-function-const.png" alt-text="Screenshot of the editor suggesting to make member const." :::
62+
:::image type="complex" source="media/lnt-make-member-function-const.png" alt-text="Screenshot of the editor suggesting to make member const." :::
6363
The cursor is on the line int getValue() and **Show potential fixes** appeared and was chosen. Now **Make member const** is visible and it shows the get value function with const added to it. You can now choose **Make member const** to make the change.
6464
:::image-end:::
6565

6666
Make this change for all flagged member functions.
6767

6868
## Remarks
6969

70-
This check focuses on `const` usage for member functions in C++ code. The C++ Core Guidelines recommends marking member functions as `const` when they don't modify the object's state.
70+
Introduced in Visual Studio 2022 17.8, this check focuses on `const` usage for member functions in C++ code. The C++ Core Guidelines recommends marking member functions as `const` when they don't modify the object's state.
7171

7272
The current implementation of this check allows you to add `const` to member functions after their declaration. It's a good practice to declare member functions as `const` from the beginning if they don't modify the object's state.
7373

docs/ide/lnt-naming-convention.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: lnt-naming-convention
33
description: "Reference for Visual Studio C++ IntelliSense Linter check lnt-naming-convention."
4-
ms.date: 09/27/2023
4+
ms.date: 09/28/2023
55
f1_keywords: ["lnt-naming-convention"]
66
helpviewer_keywords: ["lnt-naming-convention"]
77
monikerRange: ">=msvc-170"
@@ -23,7 +23,7 @@ cpp_naming_style.boolean_style.capitalization = pascal_case
2323
cpp_naming_style.boolean_style.required_prefix = b
2424
```
2525

26-
The linter will flag the following code because it isn't prefixed with 'b' and it isn't Pascal case, as specified in the `.editorconfig` file:
26+
The linter will flag the following code because it isn't prefixed with 'b' and because it isn't Pascal case, as specified in the `.editorconfig` file:
2727

2828
```cpp
2929
void example()
@@ -51,7 +51,7 @@ The code editor shows bool myFlag = true. With the cursor on that line of code,
5151

5252
## Remarks
5353

54-
The `lnt-naming-convention` linter check ensures that naming conventions align with naming conventions specified in the `editorconfig` file. You can apply this check to any project that has an `editorconfig` file. You can also customize your `.editorconfig` file to suit your project's coding style.
54+
Introduced in Visual Studio 2022 17.7, the `lnt-naming-convention` linter check ensures that naming conventions align with naming conventions specified in the `editorconfig` file. You can apply this check to any project that has an `editorconfig` file. You can also customize your `.editorconfig` file to suit your project's coding style.
5555

5656
## See also
5757

0 commit comments

Comments
 (0)