Compiler Error C2691
'data type' : a managed or WinRTarray cannot have this element type
The type of a managed or WinRT array element can be a value type or a reference type.
The following sample generates C2691:
// C2691a.cpp
// compile with: /clr
class A {};
int main() {
array<A>^ a1 = gcnew array<A>(20); // C2691
array<int>^ a2 = gcnew array<int>(20); // value type OK
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for