opSlice and $

Sean Kelly sean at f4.ca
Tue Sep 11 11:16:42 PDT 2007


Russell Lewis wrote:
> It appears to me, looking at the spec, that there isn't a way to support 
> the use of $ in operator overloading.  Is there anything I've 
> overlooked?  What I'm looking for, of course, is to be able to do:
> 
> class MyClass {....}
> 
> MyClass c = new MyClass;
> auto x = c[1..$];

The '$' symbol should map to "size_t length()" when used with opSlice, 
but at the moment I don't think this is the case.


Sean



More information about the Digitalmars-d mailing list