Here is my code:
using namespace System;
using namespace System::Collections;
using namespace System::Collections::Generic;
namespace Tests {
ref class MyCollection : public IEnumerable<int> <----HERE!
The C# compiler, for instance, will recognize that the only IEnumerable<T>
it has in those namespaces is from System::Collections::Generic
. Why can't the C++/CLI compiler do the same? Unlesss I type its full name or at least Generic::IEnumerable<int>
, it won't recognize it and will fire a C2872 error: ambiguous symbol.
Am I missing something here?
Given your namespaces IEnumerable is ambiguous
MS define IEnumerable in both System::Collections and System::Collections::Generic which of the 2 do you want your code to use?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With