Skip to content

Commit 9a496eb

Browse files
authored
Merge pull request #5669 from Rageking8/structure-error-references-in-range-c3221-c3250
Structure error references in range [C3221, C3250]
2 parents 4f09846 + 5350e44 commit 9a496eb

26 files changed

+191
-135
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C3222"
32
title: "Compiler Error C3222"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3222"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3222"]
66
helpviewer_keywords: ["C3222"]
7-
ms.assetid: 5624bde8-2fd0-4b8b-92ce-5dfbaf91cf93
87
---
98
# Compiler Error C3222
109

11-
'parameter' : cannot declare default arguments for member functions of a managed or WinRT type or generic functions
10+
> 'parameter' : cannot declare default arguments for member functions of a managed or WinRT type or generic functions
11+
12+
## Remarks
1213

1314
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.
1415

15-
The following sample generates C3222:
16+
## Example
17+
18+
The following example generates C3222:
1619

1720
```cpp
1821
// C3222_2.cpp

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C3223"
32
title: "Compiler Error C3223"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3223"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3223"]
66
helpviewer_keywords: ["C3223"]
7-
ms.assetid: 1f4380b4-0413-40db-a868-62f97babaf78
87
---
98
# Compiler Error C3223
109

11-
'property' : you cannot apply 'typeid' to a property
10+
> 'property' : you cannot apply 'typeid' to a property
11+
12+
## Remarks
1213

1314
You cannot apply [typeid](../../extensions/typeid-cpp-component-extensions.md) to a property.
1415

1516
## Example
1617

17-
The following sample generates C3223.
18+
The following example generates C3223.
1819

1920
```cpp
2021
// C3223.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C3224"
32
title: "Compiler Error C3224"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3224"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3224"]
66
helpviewer_keywords: ["C3224"]
7-
ms.assetid: 129be22f-8f3e-4fc6-9ccd-d27d8ef91251
87
---
98
# Compiler Error C3224
109

11-
'type' : no overloaded generic class takes 'number' generic type arguments
10+
> 'type' : no overloaded generic class takes 'number' generic type arguments
11+
12+
## Remarks
1213

1314
The compiler failed to find an appropriate overload.
1415

15-
The following sample generates C3224:
16+
## Example
17+
18+
The following example generates C3224:
1619

1720
```
1821
// C3224.cs

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C3225"
32
title: "Compiler Error C3225"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3225"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3225"]
66
helpviewer_keywords: ["C3225"]
7-
ms.assetid: f5f66973-256e-4298-ac46-c87819cbde34
87
---
98
# Compiler Error C3225
109

11-
generic type argument for 'arg' cannot be 'type', it must be a value type or handle type
10+
> generic type argument for 'arg' cannot be 'type', it must be a value type or handle type
11+
12+
## Remarks
1213

1314
The generic type argument was not of the correct type.
1415

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

1718
## Examples
1819

19-
You cannot instantiate a generic type with a native type. The following sample generates C3225.
20+
You cannot instantiate a generic type with a native type. The following example generates C3225.
2021

2122
```cpp
2223
// C3225.cpp
@@ -34,7 +35,7 @@ int main() {
3435
}
3536
```
3637
37-
The following sample creates a component using C#. Notice that the constraint specifies that the generic type can only be instantiated with a value type.
38+
The following example creates a component using C#. Notice that the constraint specifies that the generic type can only be instantiated with a value type.
3839
3940
```
4041
// C3225_b.cs
@@ -43,7 +44,7 @@ The following sample creates a component using C#. Notice that the constraint sp
4344
public class MyList<T> where T: struct {}
4445
```
4546
46-
This sample consumes the C#-authored component, and violates the constraint that MyList can only be instantiated with a value type other than <xref:System.Nullable>. The following sample generates C3225.
47+
This example consumes the C#-authored component, and violates the constraint that MyList can only be instantiated with a value type other than <xref:System.Nullable>. The following example generates C3225.
4748
4849
```cpp
4950
// C3225_c.cpp

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C3226"
32
title: "Compiler Error C3226"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3226"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3226"]
66
helpviewer_keywords: ["C3226"]
7-
ms.assetid: 636106ca-6f4e-4303-a6a0-8803221ec67d
87
---
98
# Compiler Error C3226
109

11-
A template declaration is not allowed inside a generic declaration
10+
> A template declaration is not allowed inside a generic declaration
11+
12+
## Remarks
1213

1314
Use a generic declaration inside a generic class.
1415

15-
The following sample generates C3226:
16+
## Example
17+
18+
The following example generates C3226:
1619

1720
```cpp
1821
// C3226.cpp
@@ -24,7 +27,7 @@ ref class C {
2427
};
2528
```
2629
27-
The following sample demonstrates a possible resolution:
30+
The following example demonstrates a possible resolution:
2831
2932
```cpp
3033
// C3226b.cpp

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
2-
description: "Learn more about: Compiler Error C3227"
32
title: "Compiler Error C3227"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3227"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3227"]
66
helpviewer_keywords: ["C3227"]
7-
ms.assetid: 7939c23a-96c8-43c2-89e9-f217d132d155
87
---
98
# Compiler Error C3227
109

11-
'parameter' : cannot use 'keyword' to allocate a generic type
10+
> 'parameter' : cannot use 'keyword' to allocate a generic type
11+
12+
## Remarks
1213

1314
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.
1415

1516
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.
1617

1718
## Example
1819

19-
The following sample generates C3227.
20+
The following example generates C3227.
2021

2122
```cpp
2223
// C3227.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C3228"
32
title: "Compiler Error C3228"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3228"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3228"]
66
helpviewer_keywords: ["C3228"]
7-
ms.assetid: 9015adf9-17b0-4312-b4a7-c1f33e4126f4
87
---
98
# Compiler Error C3228
109

11-
'function' : generic type argument for 'param' cannot be 'type', it must be a valuetype or handle type
10+
> 'function' : generic type argument for 'param' cannot be 'type', it must be a valuetype or handle type
11+
12+
## Remarks
1213

1314
An incorrect type was passed as a generic type argument.
1415

15-
The following sample generates C3228:
16+
## Example
17+
18+
The following example generates C3228:
1619

1720
```cpp
1821
// C3228.cpp

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C3229"
32
title: "Compiler Error C3229"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3229"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3229"]
66
helpviewer_keywords: ["C3229"]
7-
ms.assetid: f2d90923-aa8b-444f-ab10-1f37dbb864e1
87
---
98
# Compiler Error C3229
109

11-
'type' : indirections on a generic type parameter are not allowed
10+
> 'type' : indirections on a generic type parameter are not allowed
11+
12+
## Remarks
1213

1314
You cannot use generic parameters with `*`, `^`, or `&`.
1415

1516
## Examples
1617

17-
The following sample generates C3229.
18+
The following example generates C3229.
1819

1920
```cpp
2021
// C3229.cpp
@@ -31,7 +32,7 @@ ref class D {
3132
};
3233
```
3334
34-
The following sample generates C3229.
35+
The following example generates C3229.
3536
3637
```cpp
3738
// C3229_b.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C3230"
32
title: "Compiler Error C3230"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3230"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3230"]
66
helpviewer_keywords: ["C3230"]
7-
ms.assetid: 5ec53f25-59f6-4801-81e7-7b68bf04994d
87
---
98
# Compiler Error C3230
109

11-
'function' : template type argument for 'template' cannot contain a generic type parameter: 'param'
10+
> 'function' : template type argument for 'template' cannot contain a generic type parameter: 'param'
11+
12+
## Remarks
1213

1314
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.
1415

15-
The following sample generates C3230:
16+
## Example
17+
18+
The following example generates C3230:
1619

1720
```cpp
1821
// C3230.cpp

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
2-
description: "Learn more about: Compiler Error C3231"
32
title: "Compiler Error C3231"
4-
ms.date: "11/04/2016"
3+
description: "Learn more about: Compiler Error C3231"
4+
ms.date: 11/04/2016
55
f1_keywords: ["C3231"]
66
helpviewer_keywords: ["C3231"]
7-
ms.assetid: fe5dc352-e634-45fa-9534-3da176294c98
87
---
98
# Compiler Error C3231
109

11-
'arg' : template type argument cannot use a generic type parameter
10+
> 'arg' : template type argument cannot use a generic type parameter
11+
12+
## Remarks
1213

1314
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.
1415

15-
The following sample generates C3231:
16+
## Example
17+
18+
The following example generates C3231:
1619

1720
```cpp
1821
// C3231.cpp

0 commit comments

Comments
 (0)