Skip to content

Commit e724337

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C2821, C2850]
1 parent b080dbf commit e724337

21 files changed

+64
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: e8d71988-a968-4484-94db-e8c3bad74a4a
1010

1111
> first formal parameter to 'operator new' must be 'unsigned int'
1212
13+
## Remarks
14+
1315
The first formal parameter of the [operator new](../../standard-library/new-operators.md#op_new) must be an unsigned **`int`**.
1416

1517
## Example

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 982b1b35-1a7c-456e-b711-f80cfe2d571e
1010

1111
> a typedef template is illegal
1212
13+
## Remarks
14+
1315
Templates are not allowed in **`typedef`** definitions.
1416

1517
## Example

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 5bd865f7-e0af-404e-80fe-e2b798b44a59
1010

1111
> return type for 'operator new' must be 'void *'
1212
13+
## Remarks
14+
1315
With non-based pointers, overloads of operator `new` must return `void *`.
1416

17+
## Example
18+
1519
The following sample generates C2824:
1620

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: c832f1c1-5184-4fc2-9356-12b21daa7af3
1010

1111
> var : must be a class or namespace when followed by '::'
1212
13+
## Remarks
14+
1315
An unsuccessful attempt was made to form a qualified name.
1416

1517
For example, make sure that your code does not contain a function declaration where the function name begins with ::.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: cb3e5814-0c92-40e4-b620-98578ae3003a
1010

1111
> 'operator operator' cannot be globally overridden with unary form
1212
13+
## Remarks
14+
1315
The operator cannot have a unary form outside of an object.
1416

1517
### To fix by using the following possible solutions

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: d8df6ed4-5954-46c2-b59b-52881d4e923d
1010

1111
> 'operator operator' cannot be globally overridden with binary form
1212
13+
## Remarks
14+
1315
The operator cannot have a binary form outside of an object.
1416

1517
### To fix by using the following possible solutions

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: b3bfecb8-c8c1-45fd-bb85-4b42a6b8ed2b
1010

1111
> 'operator operator' cannot have a variable parameter list
1212
13+
## Remarks
14+
1315
Only two operators can take variable parameter lists:
1416

1517
- Function call `()`

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ ms.assetid: 91607d2d-6aab-4c1b-b253-a7b8ec37760e
1010

1111
> only placement parameters to 'operator new' can have default values
1212
13+
## Remarks
14+
1315
The standard formal parameters for [operator new](../../standard-library/new-operators.md#op_new) cannot have default values. Only user-defined placement parameters can specify defaults.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: c8c04288-0889-4265-a077-17f94cbcdcc9
1010

1111
> 'operator operator' cannot have default parameters
1212
13+
## Remarks
14+
1315
Only three operators can have default parameters:
1416

1517
- [new](../../cpp/new-operator-cpp.md)
@@ -18,6 +20,8 @@ Only three operators can have default parameters:
1820

1921
- Left parenthesis (
2022

23+
## Example
24+
2125
The following sample generates C2831:
2226

2327
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ ms.assetid: b9418ce1-e2ee-4599-8959-6fde89c27569
1010

1111
> 'operator *operator-name*' is not a recognized operator or type
1212
13+
## Remarks
14+
1315
The word **`operator`** must be followed by an *operator-name* that you want to override or a type you want to convert.
1416

1517
For a list of the operators that you can define in a managed type, see [User-defined Operators](../../dotnet/user-defined-operators-cpp-cli.md).
1618

19+
## Example
20+
1721
The following sample generates C2833:
1822

1923
```cpp

0 commit comments

Comments
 (0)