https://issues.dlang.org/show_bug.cgi?id=18998

--- Comment #5 from Nick Treleaven <[email protected]> ---
> try and understand how to implement a slicing operator properly. Note that 
> the first contact you see looks like this:
>   `-a[i..j]    a.opIndexUnary!("-")(a.opSlice(i, j))`  wat?!

I think the docs for opIndexUnary, opIndexAssign and opIndexOpAssign should be
moved to the Indexing and Slicing Operators section where they make more sense.

> Make a point that multi-dimensional indexing is even supported, and that it 
> is a separate topic, 

With the 2nd pull I have tweaked the slicing docs to introduce 1D slicing first
with an example, then move on to multidimensional.

> and requires different handling than 1d.

Well non-template opSlice(i, j) 'is discouraged', so they're not different
really.

--

Reply via email to