Range Type

Craig Black cblack at ara.com
Mon Mar 24 07:27:43 PDT 2008


"Janice Caron" <caron800 at googlemail.com> wrote in message 
news:mailman.192.1206357352.2351.digitalmars-d at puremagic.com...
>I know this has cropped up before (in discussions about multiple
> dimension arrays), but adding a range type would also really help with
> the whole business of returning slices. (See the many other threads
> currently buzzing with this topic).
>
> A range is nothing more than a two-element struct
>
>    struct Range(T,U=T)
>    {
>        T begin;
>        U end;
>    }
>

Why would the type T and U ever be different?  What's the point of the 
second type being different than the first?

-Craig 





More information about the Digitalmars-d mailing list