Ranges
Lionello Lunesu
lionello at lunesu.remove.com
Thu Jun 18 23:09:17 PDT 2009
"dsimcha" <dsimcha at yahoo.com> wrote in message
news:h1e6qp$umo$1 at digitalmars.com...
> 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; }".
L.
More information about the Digitalmars-d
mailing list