Skip to content

Commit 0dbfd7d

Browse files
authored
Add "Remarks" and "Example" headings for error references in range [C3221, C3250]
1 parent ec3814b commit 0dbfd7d

26 files changed

+82
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 5624bde8-2fd0-4b8b-92ce-5dfbaf91cf93
1010

1111
> 'parameter' : cannot declare default arguments for member functions of a managed or WinRT type or generic functions
1212
13+
## Remarks
14+
1315
It is not permitted to declare a method parameter with a default argument. An overloaded form of the method is one way to work around this issue. That is, define a method with the same name with no parameters and then initialize the variable in the method body.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 1f4380b4-0413-40db-a868-62f97babaf78
1010

1111
> 'property' : you cannot apply 'typeid' to a property
1212
13+
## Remarks
14+
1315
You cannot apply [typeid](../../extensions/typeid-cpp-component-extensions.md) to a property.
1416

1517
## Example

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 129be22f-8f3e-4fc6-9ccd-d27d8ef91251
1010

1111
> 'type' : no overloaded generic class takes 'number' generic type arguments
1212
13+
## Remarks
14+
1315
The compiler failed to find an appropriate overload.
1416

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

1721
```

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: f5f66973-256e-4298-ac46-c87819cbde34
1010

1111
> generic type argument for 'arg' cannot be 'type', it must be a value type or handle type
1212
13+
## Remarks
14+
1315
The generic type argument was not of the correct type.
1416

1517
For more information, see [Generics](../../extensions/generics-cpp-component-extensions.md).

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 636106ca-6f4e-4303-a6a0-8803221ec67d
1010

1111
> A template declaration is not allowed inside a generic declaration
1212
13+
## Remarks
14+
1315
Use a generic declaration inside a generic class.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: 7939c23a-96c8-43c2-89e9-f217d132d155
1010

1111
> 'parameter' : cannot use 'keyword' to allocate a generic type
1212
13+
## Remarks
14+
1315
In order to instantiate a type, an appropriate constructor is required. However, the compiler is not able to ensure that an appropriate constructor is available.
1416

1517
You can use templates instead of generics to resolve this error, or you can use one of several methods to create an instance of the type.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 9015adf9-17b0-4312-b4a7-c1f33e4126f4
1010

1111
> 'function' : generic type argument for 'param' cannot be 'type', it must be a valuetype or handle type
1212
13+
## Remarks
14+
1315
An incorrect type was passed as a generic type argument.
1416

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

1721
```cpp

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ms.assetid: f2d90923-aa8b-444f-ab10-1f37dbb864e1
1010

1111
> 'type' : indirections on a generic type parameter are not allowed
1212
13+
## Remarks
14+
1315
You cannot use generic parameters with `*`, `^`, or `&`.
1416

1517
## Examples

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: 5ec53f25-59f6-4801-81e7-7b68bf04994d
1010

1111
> 'function' : template type argument for 'template' cannot contain a generic type parameter: 'param'
1212
13+
## Remarks
14+
1315
Templates are instantiated at compile time, but generics are instantiated at run time. Therefore, it is not possible to generate generic code that can call the template because the template cannot be instantiated at run time when the generic type is finally known.
1416

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

1721
```cpp

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ ms.assetid: fe5dc352-e634-45fa-9534-3da176294c98
1010

1111
> 'arg' : template type argument cannot use a generic type parameter
1212
13+
## Remarks
14+
1315
Templates are instantiated at compile time, but generics are instantiated at run time. Therefore, it is not possible to generate generic code that can call the template because the template cannot be instantiated at run time when the generic type is finally known.
1416

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

1721
```cpp

0 commit comments

Comments
 (0)