Ranges
Ary Borenszweig
ary at esperanto.org.ar
Fri Jun 19 06:46:54 PDT 2009
Lionello Lunesu wrote:
>
> "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; }".
Wow. :-)
You always learn something new...
Thanks, Lionello!
More information about the Digitalmars-d
mailing list