NdArray icon indicating copy to clipboard operation
NdArray copied to clipboard

support varargs on subscripts

Open dastrobu opened this issue 3 years ago • 0 comments

when the old style index API is removed, varargs can be added:

    /**
     slice access
     */
    public subscript(slices: Slice...) -> NdArray<T> {
        get {
            self[slices]
        }
        set {
            self[slices] = newValue
        }
    }

    /**
     index access
     */
    public subscript(index: Int...) -> T {
        get {
            self[index]
        }
        set {
            self[index] = newValue
        }
    }

dastrobu avatar Feb 21 '22 05:02 dastrobu