ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

Implement/make public `ArrayBase::split_at`

Open multimeric opened this issue 4 years ago • 2 comments
trafficstars

Currently ArrayBase::split_at is private, and only ArrayView::split_at is public. However there are situations where you might want to split an owned array. For example in a factory function that generates an Array, you want to move the array into the calling frame, but you also want to split the array into pieces. This is currently not possible.

Can we make ArrayBase::split_at public, or else implement Array::split_at?

multimeric avatar Jul 28 '21 12:07 multimeric

There is no way to split an owned array, unfortunately, there is no private method that does that. It would require allocation and copying by the way, to do that.

bluss avatar Jul 29 '21 21:07 bluss

Huh okay the compiler told me there was a private implementation of ArrayBase::split_at. Well in that case I guess this is a feature request for an owned array to be able to split, with copying if necessary.

multimeric avatar Jul 30 '21 02:07 multimeric