<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Implementing the generic IEnumerable interface</title>
	<atom:link href="http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/feed/" rel="self" type="application/rss+xml" />
	<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/</link>
	<description>... but that doesn&#039;t matter, because I turn it into a sexy dance</description>
	<lastBuildDate>Tue, 25 Oct 2011 15:04:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jim Davis</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-8384</link>
		<dc:creator>Jim Davis</dc:creator>
		<pubDate>Wed, 08 Sep 2010 04:41:41 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-8384</guid>
		<description>&lt;p&gt;Thank you.  Perfect explanation&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you.  Perfect explanation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: imax theater locations</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-8264</link>
		<dc:creator>imax theater locations</dc:creator>
		<pubDate>Mon, 23 Aug 2010 22:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-8264</guid>
		<description>&lt;p&gt;ive had to &quot;re-learn&quot; this ugly bug several times now.. every time...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>ive had to &#8220;re-learn&#8221; this ugly bug several times now.. every time&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vjeran</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-129</link>
		<dc:creator>vjeran</dc:creator>
		<pubDate>Tue, 14 Aug 2007 16:12:45 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-129</guid>
		<description>Thanks.. well hard to get this .. they should publish this hack on msdn. I was totaly confused.</description>
		<content:encoded><![CDATA[<p>Thanks.. well hard to get this .. they should publish this hack on msdn. I was totaly confused.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Piepgrass</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-128</link>
		<dc:creator>David Piepgrass</dc:creator>
		<pubDate>Sat, 30 Jun 2007 12:59:17 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-128</guid>
		<description>Argh, there are several web sites that teach how to use iterators without mentioning this. Like this Microsoft article: http://msdn.microsoft.com/msdnmag/issues/04/05/C20/

One wonders why C# can&#039;t supply the second GetEnumerator() function automatically.</description>
		<content:encoded><![CDATA[<p>Argh, there are several web sites that teach how to use iterators without mentioning this. Like this Microsoft article: <a href="http://msdn.microsoft.com/msdnmag/issues/04/05/C20/" rel="nofollow">http://msdn.microsoft.com/msdnmag/issues/04/05/C20/</a></p>
<p>One wonders why C# can&#8217;t supply the second GetEnumerator() function automatically.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-127</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Fri, 25 May 2007 07:26:26 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-127</guid>
		<description>Rubio:

Is it possible for you to post a minimal example showing the error. Similar to the &lt;code&gt;Ints&lt;/code&gt; example in the post?

For example, here is a generic repeater class.  That is, when you construct the class you give it an element to repeat and how many times it should be repeated.

&lt;code&gt;&lt;pre&gt;
using System;
using System.Collections.Generic;

class Repeater&lt;T&gt; : IEnumerable&lt;T&gt; {
  private readonly T elem;
  private readonly int no_of_times;
  public Repeater(int no, T e) { no_of_times = no; elem = e; }
  public IEnumerator&lt;T&gt; GetEnumerator() {
    for(int i = 0; i &lt; no_of_times; ++i)
      yield return elem;
  }
  System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
    return GetEnumerator();
  }
}

class MainClass {
  public static void Main(string[] args) {
     Repeater&lt;string&gt; hellos = new Repeater&lt;string&gt;(10, &quot;Hello&quot;);
     foreach (string s in hellos)
        Console.WriteLine(s);
  }
}
&lt;/pre&gt;&lt;/pre&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Rubio:</p>
<p>Is it possible for you to post a minimal example showing the error. Similar to the <code>Ints</code> example in the post?</p>
<p>For example, here is a generic repeater class.  That is, when you construct the class you give it an element to repeat and how many times it should be repeated.</p>
<p><code>
<pre>
using System;
using System.Collections.Generic;

class Repeater&lt;T&gt; : IEnumerable&lt;T&gt; {
  private readonly T elem;
  private readonly int no_of_times;
  public Repeater(int no, T e) { no_of_times = no; elem = e; }
  public IEnumerator&lt;T&gt; GetEnumerator() {
    for(int i = 0; i < no_of_times; ++i)
      yield return elem;
  }
  System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
    return GetEnumerator();
  }
}

class MainClass {
  public static void Main(string[] args) {
     Repeater&lt;string&gt; hellos = new Repeater&lt;string&gt;(10, "Hello");
     foreach (string s in hellos)
        Console.WriteLine(s);
  }
}
</pre>
</pre>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rubio</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-126</link>
		<dc:creator>Rubio</dc:creator>
		<pubDate>Thu, 24 May 2007 09:51:04 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-126</guid>
		<description>Interesting. I originally got the same compiler error (does not implement interface member &#039;System.Collections.IEnumerable.GetEnumerator()&#039;). I then inserted the non-generic method call. Now the compiler error says I&#039;m not implementing IEnumerable.GetEnumerator(). That method, of course, has been in the class all along (and it is public).The difference here is that my class (that implements IEnumerable) is also generic. In any case, I still don&#039;t know what I should do.</description>
		<content:encoded><![CDATA[<p>Interesting. I originally got the same compiler error (does not implement interface member &#8216;System.Collections.IEnumerable.GetEnumerator()&#8217;). I then inserted the non-generic method call. Now the compiler error says I&#8217;m not implementing IEnumerable.GetEnumerator(). That method, of course, has been in the class all along (and it is public).The difference here is that my class (that implements IEnumerable) is also generic. In any case, I still don&#8217;t know what I should do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Albury</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-125</link>
		<dc:creator>Richard Albury</dc:creator>
		<pubDate>Tue, 03 Apr 2007 23:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-125</guid>
		<description>Ditto.  Many thanks!</description>
		<content:encoded><![CDATA[<p>Ditto.  Many thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: blacktea</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-124</link>
		<dc:creator>blacktea</dc:creator>
		<pubDate>Fri, 05 Jan 2007 18:08:57 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-124</guid>
		<description>Argh!!!!  curse the IEnumerator designer who wasted hours of my time on this compile time error!!!!</description>
		<content:encoded><![CDATA[<p>Argh!!!!  curse the IEnumerator designer who wasted hours of my time on this compile time error!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Coleman</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-123</link>
		<dc:creator>Coleman</dc:creator>
		<pubDate>Mon, 28 Aug 2006 12:59:12 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-123</guid>
		<description>Very Helprful!</description>
		<content:encoded><![CDATA[<p>Very Helprful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: james</title>
		<link>http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/comment-page-1/#comment-122</link>
		<dc:creator>james</dc:creator>
		<pubDate>Thu, 20 Jul 2006 10:28:43 +0000</pubDate>
		<guid isPermaLink="false">http://ken.friislarsen.net/blog/2005/07/25/implementing-the-generic-ienumerable-interface/#comment-122</guid>
		<description>hey! thanks for this. ive been tearing my hair out trying to figure out whats going on here. didnt make any sense AT all.  some of these little nuances can drive you nuts.</description>
		<content:encoded><![CDATA[<p>hey! thanks for this. ive been tearing my hair out trying to figure out whats going on here. didnt make any sense AT all.  some of these little nuances can drive you nuts.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

