Hello everyone,
I am wondering why do we need to derive some type from IEnumerator<T>? Could anyone show me some useful samples?
I think using IEnumerator<T> itself should be enough in all cases?
thanks in advance,
George
Hello everyone,
I am wondering why do we need to derive some type from IEnumerator<T>? Could anyone show me some useful samples?
I think using IEnumerator<T> itself should be enough in all cases?
thanks in advance,
George
Know the answer? Post it. Somebody with the same question will find it here.
Former memberPosted May 3, 2008, 3:43 PM EDT
Also, its just coding etiquette but you dont technically "derive" from an interface, you implement it. And interface basically says that this certain class (the class that implements it) is guaranteed to have these members. It works nicely in generics, much like a base class, but it does not declare instance members. Meaning you dont have to worry about the base members it contains.
George GeorgeRank #2,261 · 618 pointsPosted May 3, 2008, 7:49 PM EDT
Thanks buddy,
What makes me confused is about how to write the constructor of the class which implements IEnumarator<T>, could you show me a sample please?
regards,
George