Ranges

BLS windevguy at hotmail.de
Fri Jun 19 00:26:00 PDT 2009


dsimcha wrote:

> Ranges are just pretty much an implicit compile-time interface.  As Ary put it,
> compile time duck typing is a pretty accurate description.  Basically, a range
> doesn't have to *be* a specific *type*, it just has to support certain specific
> *operations*, namely front, popFront, and empty.  As long as it *has* these
> operations, and they compile and return what they're supposed to (ElementType!(T)
> for front(), void for popFront() and bool for empty), it doesn't matter what type
> it *is*.

What I don't get is how this (definition) may work on tree based 
structures. To me it seems that ranges work fine on "linear" data types 
(whatever) lists, but well,  as said I don't get it. :(



More information about the Digitalmars-d mailing list