Skip to content

Commit 42595e1

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C3481, C3530]
1 parent 878f5e1 commit 42595e1

25 files changed

+67
-9
lines changed

docs/error-messages/compiler-errors-2/compiler-error-c3481.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 5d09375a-5ed3-4b61-86ed-45e91fd734c7
1010

1111
> 'var': lambda capture variable not found
1212
13+
## Remarks
14+
1315
The compiler could not find the definition of a variable that you passed to the capture list of a lambda expression.
1416

1517
### To correct this error

docs/error-messages/compiler-errors-2/compiler-error-c3482.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: bf99558e-bef4-421c-bb16-dcd9c54c1011
1010

1111
> 'this' can only be used as a lambda capture within a non-static member function
1212
13+
## Remarks
14+
1315
You cannot pass **`this`** to the capture list of a lambda expression that is declared in a static method or a global function.
1416

1517
### To correct this error

docs/error-messages/compiler-errors-2/compiler-error-c3483.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 18b3a2c5-dfc9-4661-9653-08a5798474cf
1010

1111
> 'var' is already part of the lambda capture list
1212
13+
## Remarks
14+
1315
You passed the same variable to the capture list of a lambda expression more than one time.
1416

1517
### To correct this error

docs/error-messages/compiler-errors-2/compiler-error-c3484.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ ms.assetid: 2fe847fa-f6ee-4978-bc1d-b6dc6ae906ac
1010

1111
> expected '->' before the return type
1212
13+
## Remarks
14+
1315
You must provide `->` before the return type of a lambda expression.
1416

1517
### To correct this error
1618

1719
- Provide `->` before the return type.
1820

19-
## Examples
21+
## Example
2022

2123
The following example generates C3484:
2224

docs/error-messages/compiler-errors-2/compiler-error-c3487.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 39bda474-4418-4a79-98bf-2b22fa92eaaa
1010

1111
> 'return type': all return expressions must deduce to the same type: previously it was 'return type'
1212
13+
## Remarks
14+
1315
A lambda must specify its return type unless it contains a single return statement. If a lambda contains multiple return statements, they must all have the same type.
1416

1517
### To correct this error

docs/error-messages/compiler-errors-2/compiler-error-c3488.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 0a6fcd76-dd3b-48d7-abb3-22eccda96034
1010

1111
> 'var' is not allowed when the default capture mode is by-reference
1212
13+
## Remarks
14+
1315
When you specify that the default capture mode for a lambda expression is by-reference, you cannot pass a variable by reference to the capture clause of that expression.
1416

1517
### To correct this error
@@ -22,7 +24,7 @@ When you specify that the default capture mode for a lambda expression is by-ref
2224

2325
- Pass the variable by value to the capture clause. (This might change the behavior of the lambda expression.)
2426

25-
## Examples
27+
## Example
2628

2729
The following example generates C3488 because a reference to the variable `n` appears in the capture clause of a lambda expression whose default mode is by-reference:
2830

docs/error-messages/compiler-errors-2/compiler-error-c3489.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 47b58d69-459d-4499-abc7-5f0b9303d773
1010

1111
> 'var' is required when the default capture mode is by-value
1212
13+
## Remarks
14+
1315
When you specify that the default capture mode for a lambda expression is by-value, you cannot pass a variable by value to the capture clause of that expression.
1416

1517
### To correct this error
@@ -22,7 +24,7 @@ When you specify that the default capture mode for a lambda expression is by-val
2224

2325
- Pass the variable by reference to the capture clause. (This might change the behavior of the lambda expression.)
2426

25-
## Examples
27+
## Example
2628

2729
The following example generates C3489 variable `n` appears by value in the capture clause of a lambda expression whose default mode is by-value:
2830

docs/error-messages/compiler-errors-2/compiler-error-c3490.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ ms.assetid: 7638559a-fd06-4527-a9c1-0c8ae68b3123
1010

1111
> 'var' cannot be modified because it is being accessed through a const object
1212
13+
## Remarks
14+
1315
A lambda expression that is declared in a **`const`** method cannot modify non-mutable member data.
1416

1517
### To correct this error
1618

1719
- Remove the **`const`** modifier from your method declaration.
1820

19-
## Examples
21+
## Example
2022

2123
The following example generates C3490 because it modifies the member variable `_i` in a **`const`** method:
2224

docs/error-messages/compiler-errors-2/compiler-error-c3491.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 7f0e71b2-46a0-4d25-bd09-6158a280f509
1010

1111
> 'var': a by-value capture cannot be modified in a non-mutable lambda
1212
13+
## Remarks
14+
1315
A non-mutable lambda expression cannot modify the value of a variable that is captured by value.
1416

1517
### To correct this error
@@ -18,7 +20,7 @@ A non-mutable lambda expression cannot modify the value of a variable that is ca
1820

1921
- Pass the variable by reference to the capture list of the lambda expression.
2022

21-
## Examples
23+
## Example
2224

2325
The following example generates C3491 because the body of a non-mutable lambda expression modifies the capture variable `m`:
2426

docs/error-messages/compiler-errors-2/compiler-error-c3492.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ ms.assetid: b1dc6342-9133-4b1f-a9c3-e8c65d20d121
1010

1111
> 'var': you cannot capture a member of an anonymous union
1212
13+
## Remarks
14+
1315
You cannot capture a member of an unnamed union.
1416

1517
### To correct this error
1618

1719
- Give the union a name and pass the complete union structure to the capture list of the lambda expression.
1820

19-
## Examples
21+
## Example
2022

2123
The following example generates C3492 because it captures a member of an anonymous union:
2224

0 commit comments

Comments
 (0)