Lionello Lunesu wrote:

"dsimcha" <[email protected]> wrote in message news:[email protected]...
Ranges are really just a form of iterators that's given sane syntax (unlike C++) and relies on this compile-time duck typing instead of virtual functions and
class-based interfaces (unlike Java and C#).

Actually, C# doesn't care for the interfaces. They are just there to help you implement a compatible iterator. C#'s foreach will accept any type with "T GetEnumerator()", where type T in turn implements "bool MoveNext()" and "S Current { get; }".

Wow. :-)

You always learn something new...

Thanks, Lionello!

Reply via email to