Range Type

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Mon Mar 24 12:58:23 PDT 2008


Janice Caron wrote:
> On 24/03/2008, Craig Black <cblack at ara.com> wrote:
>> I still think we don't need that second type.  We are talking about D 2.0,
>>  so backwards.compatibility is less of an issue.  Unless there's a compelling
>>  reason for it, it should be opSlice(T, T).  I think this makes more sense,
>>  and simplifies the syntax.
> 
> I agree.
> 
> But just to be sure, let's ask the loyal readers of this newsgroup...
> Has anyone here ever used opSlice(T,U), where type T != type U? And if
> so, for what purpose, and could you live without it?

It could probably be used with something like this:
<http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=67720>

Assuming that code works (I haven't tested it myself) that should allow 
using $ in user-defined opSlice().
Pretty hack-y though; it seems to depend on a DMDFE implementation detail.



More information about the Digitalmars-d mailing list