Thread: derive from IEnumerator<T>

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    derive from IEnumerator<T>

    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

  2. #2
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    This page has an illustration of when you can create a custom iterator
    http://msdn.microsoft.com/en-us/libr...numerator.aspx

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks indigo0086,


    My question is about how to write the generics form IEnumeraot<T>, especially how to write the constructor and dealing with T. Your referred link is about the non-generics form of IEnumerator.

    Any more ideas or references? :-)

    Quote Originally Posted by indigo0086 View Post
    This page has an illustration of when you can create a custom iterator
    http://msdn.microsoft.com/en-us/libr...numerator.aspx

    regards,
    George

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to derive from class with templates
    By mikel123 in forum C++ Programming
    Replies: 2
    Last Post: 01-14-2008, 12:19 PM
  2. How To Derive from a singleton
    By appleGuy in forum C++ Programming
    Replies: 8
    Last Post: 03-24-2007, 01:55 PM