I want the C++ equivalent to the following C#.
List<int> k = myclass.method().ToList();
In my standard C++ WinForms application I have tried the following:
IEnumerable<int>^ m= myclass->method();
I get the following error:
C2872 IEnumerable ambiguous symbol
Please help me understand and resolve my issue.
There are two IEnumerable
s -- one in System::Collections
, and one in System::Collections::Generic
.
Somehow you have both in scope (probably with using directives), so you'll need to either remove said using directives or fully qualify the type name:
System::Collections::Generic::IEnumerable<int>^ m = myclass->method();