opIndex() may hide opSlice()

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Fri Mar 10 08:09:27 PST 2017


On Friday, 10 March 2017 at 15:41:31 UTC, Jonathan M Davis wrote:
> Yeah, I've never understood how it made any sense for opIndex 
> to be used for slicing, and I've never used it that way.

Yeah, I just saw that yesterday in a Phobos type and was like 
"wtf did they misname it"... but it worked.

However, I can get used to it, [] going to opIndex() isn't really 
a stretch anyway, I would just like if it was better known and 
the compiler talked about it.



More information about the Digitalmars-d mailing list