How to System::Collections::Generic::IEnumerable<T> in managed C++

F

Fred Heida

Hi,

i'm trying to (using managed C++) implment the IEnumerable<T> interface on
my class..
but have a problem with the 2 GetEnumerator method required.... what i have
done is...

generic<typename T>
public ref class SetOfProxy : public
System::Collections::Generic::IEnumerable<T>
{
virtual System::Collections::Generic::IEnumerator<T> ^GetEnumerator() =
System::Collections::Generic::IEnumerable<T>::GetEnumerator;

System::Collections::IEnumerator ^GetEnumerator() =
System::Collections::IEnumerable::GetEnumerator;
}

when i complere this... i get.... what i'm i doing wrong...

Error 1 error C2556: 'System::Collections::IEnumerator
^ManagedProxy::SetOfProxy<T>::GetEnumerator(void)' : overloaded function
differs only by return type from
'System::Collections::Generic::IEnumerator<T>
^ManagedProxy::SetOfProxy<T>::GetEnumerator(void)' c:\development
work\system modeler\ngen~2.0_cr1132\ngen\model\proxy\managedproxy\SetOf.h 65
 
M

Mattias Sjögren

i'm trying to (using managed C++) implment the IEnumerable said:
my class..
but have a problem with the 2 GetEnumerator method required.... what i have
done is...

Have you tried renaming one of the methods?


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top