[Mono-list] Problem extending collection with generics
dsmithers at talktalk.net
Wed Jan 9 09:26:28 EST 2008
Thanks Robert, that seems to sort it out.
Also, when do I need to use the override keyword? It seems a little
redundant as it can only be used for methods that have been declared
virtual in the base class.
Robert Jordan wrote:
> Dan Smithers wrote:
>> I have a small and irritating problem.
>> I want to write a collection class derived from
>> System.Collections.Generic.ICollection that contains a mathematical set.
>> I have found it difficult to get it to compile because of the
>> GetEnumerator methods.
>> I need to override both
>> System.Collections.IEnumarable.GetEnumerator and
>> If I only have one defined then gmcs complains that the other is not
>> If I have both defined then gmcs complains that I have a nome conflict.
>> Can I get round this by explicitly specifying the derivation of the
>> function. Is there any way to make it less verbose?
> This ambiguity is usually solved with an explicit interface
> IEnumerator IEnumerable.GetEnumerator ()
> Mono-list maillist - Mono-list at lists.ximian.com
More information about the Mono-list