opSlice() or opIndex() for the entire slice?
Ali Çehreli via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Sep 9 22:07:29 PDT 2014
On 09/09/2014 09:56 PM, H. S. Teoh via Digitalmars-d-learn wrote:
> Kenji's PR that
> implements multidimensional slicing; in his design, he specifically
> relegates opSlice to returning index range proxy objects
That's exactly how it finally made sense to me. :)
> By extension, therefore, it follows that implementing slice operations
> of the form A[] simply involves invoking A.opIndex() with no arguments.
I am currently writing an update to my Operator Overloading chapter to
explain all of that.
Ali
More information about the Digitalmars-d-learn
mailing list