You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iterates through an array or collection. This non-standard keyword is available in both C++/CLI and native C++ projects. However, its use is not recommended. Consider using a standard [Range-based for Statement (C++)](../cpp/range-based-for-statement-cpp.md) instead.
12
+
Iterates through an array or collection. This non-standard keyword is available in both C++/CLI and native C++ projects. However, its use isn't recommended. Consider using a standard [Range-based for Statement (C++)](../cpp/range-based-for-statement-cpp.md) instead.
12
13
13
14
## All Runtimes
14
15
@@ -34,22 +35,12 @@ One or more statements to be executed.
34
35
35
36
### Remarks
36
37
37
-
The `for each` statement is used to iterate through a collection. You can modify elements in a collection, but you cannot add or delete elements.
38
+
The `for each` statement is used to iterate through a collection. You can modify elements in a collection, but you can't add or delete elements.
38
39
39
40
The *statements* are executed for each element in the array or collection. After the iteration has been completed for all the elements in the collection, control is transferred to the statement that follows the `for each` block.
40
41
41
42
`for each` and `in` are [context-sensitive keywords](../extensions/context-sensitive-keywords-cpp-component-extensions.md).
42
43
43
-
For more information:
44
-
45
-
-[Iterating Over C++ Standard Library Collection By Using for each](../dotnet/iterating-over-stl-collection-by-using-for-each.md)
46
-
47
-
-[How to: Iterate Over Arrays with for each](../dotnet/how-to-iterate-over-arrays-with-for-each.md)
48
-
49
-
-[How to: Iterate Over a Generic Collection with for each](../dotnet/how-to-iterate-over-a-generic-collection-with-for-each.md)
50
-
51
-
-[How to: Iterate Over a User-Defined Collection with for each](../dotnet/how-to-iterate-over-a-user-defined-collection-with-for-each.md)
52
-
53
44
## Windows Runtime
54
45
55
46
### Requirements
@@ -86,8 +77,6 @@ int main() {
86
77
}
87
78
```
88
79
89
-
**Output**
90
-
91
80
```Output
92
81
abcd
93
82
@@ -96,7 +85,7 @@ Testing
96
85
97
86
## Common Language Runtime
98
87
99
-
**Remarks**
88
+
### Remarks
100
89
101
90
The CLR syntax is the same as the **All Runtimes** syntax, except as follows.
102
91
@@ -138,8 +127,6 @@ int main() {
138
127
}
139
128
```
140
129
141
-
**Output**
142
-
143
130
```Output
144
131
abcd
145
132
@@ -148,4 +135,5 @@ Testing
148
135
149
136
## See also
150
137
151
-
[Component Extensions for Runtime Platforms](../extensions/component-extensions-for-runtime-platforms.md)
138
+
[Component Extensions for Runtime Platforms](../extensions/component-extensions-for-runtime-platforms.md)\
Copy file name to clipboardExpand all lines: docs/error-messages/compiler-errors-2/compiler-error-c3287.md
+6-3
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,20 @@
1
1
---
2
2
title: "Compiler Error C3287"
3
-
ms.date: "11/04/2016"
3
+
description: "Describes Microsoft C++ compiler error C3287."
4
+
ms.date: 09/25/2020
4
5
f1_keywords: ["C3287"]
5
6
helpviewer_keywords: ["C3287"]
6
7
ms.assetid: c1fa73d2-2c82-4136-a7da-0e75e3b420ad
7
8
---
8
9
# Compiler Error C3287
9
10
10
-
the type 'type' (return type of GetEnumerator) must have a suitable public MoveNext member function and public Current property
11
+
> the type '*type*' (return type of GetEnumerator) must have a suitable public MoveNext member function and public Current property
12
+
13
+
## Remarks
11
14
12
15
User-defined collection classes must contain definitions for `MoveNext` and `Current`.
13
16
14
-
See [How to: Iterate Over a User-Defined Collection with for each](../../dotnet/how-to-iterate-over-a-user-defined-collection-with-for-each.md) for more information.
17
+
For more information, see [for each, in](../../dotnet/for-each-in.md).
Copy file name to clipboardExpand all lines: docs/extensions/generics-cpp-component-extensions.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,22 @@
1
1
---
2
2
title: "Generics (C++/CLI and C++/CX)"
3
-
ms.date: "10/12/2018"
3
+
description: "Links to content about the C++/CLI and C++/CX generics features, types, and methods."
4
+
ms.date: 09/25/2020
4
5
ms.topic: "reference"
5
6
f1_keywords: ["generic_cpp", "generic"]
6
7
helpviewer_keywords: ["generics [C++]"]
7
8
ms.assetid: c7ccc316-a411-4c00-b2e2-f0c0eadc6cfd
8
9
---
9
10
# Generics (C++/CLI and C++/CX)
10
11
11
-
Generics are parameterized types and methods. In this section, find out which generic features are supported by both the Windows Runtime and the common language runtime, and which are supported by only the common language runtime. Also, find out how to author your own generic methods and types in C++/CLI, and how to use generic types authored in a .NET Framework language in C++/CLI. Finally, this section provides a comparison of generics and C++ templates.
12
+
Generics are parameterized types and methods. In this section, find out which generic features both the Windows Runtime and the common language runtime support, and which ones only the common language runtime supports. You'll also find out how to author your own generic methods and types in C++/CLI, and how to use generic types authored in a .NET Framework language in C++/CLI. Finally, this section provides a comparison of generics and C++ templates.
12
13
13
14
## In This Section
14
15
15
16
### Supported by the Windows Runtime and the Common Language Runtime
16
17
17
18
[Overview of Generics in C++/CLI](overview-of-generics-in-visual-cpp.md)<br/>
18
-
Information about generics are, the motivation for the language feature, definitions of terms used to describe generics, and information about the use of reference types and value types as type parameters for generics.
19
+
Information about what generics are, the motivation for the language feature, and definitions of terms that are used to describe generics. Also, information about the use of reference types and value types as type parameters for generics.
0 commit comments