Saturday, August 3, 2013

Enumerators and Iterators: Why does this Enumerable not compile?

You're implementing IEnumerable.GetEnumerator, but not IEnumerable<string>.GetEnumerator - the two methods are different, in that one returns IEnumerator, and the other returns IEnumerator<string>


To make your class compile, you need to implement both.




Reed Copsey, Jr. - http://reedcopsey.com - If a post answers your question, please click Mark As Answer on that post. If you find a post helpful, please click Vote as Helpful.


No comments:

Post a Comment