opIndex negative index?

cerjones who at what.com
Thu Jan 21 22:29:38 UTC 2021


On Thursday, 21 January 2021 at 15:55:02 UTC, IGotD- wrote:
> On Thursday, 21 January 2021 at 15:49:02 UTC, IGotD- wrote:
>> On Thursday, 21 January 2021 at 14:47:38 UTC, cerjones wrote:
>>>
>>> ohreally?
>>
>> I thought you were talking about the built in arrays.
>
> Since you create your own implementation just as you showed you 
> are basically free to do anything. That also includes that you 
> are free to create your own iterator as well.

Tbh I was just a bit uneasy about negative indexes from a design 
point of view, you know when something just doesnt feel right. So 
anyway I coded it up and decided I didnt like it anyway, just 
looks weird having

doSomthing(path[-1].x, path[-1].y);

so im going to stick with it as it is.



More information about the Digitalmars-d-learn mailing list