Skip to content

Implement/make public ArrayBase::split_at #1048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
multimeric opened this issue Jul 28, 2021 · 2 comments
Open

Implement/make public ArrayBase::split_at #1048

multimeric opened this issue Jul 28, 2021 · 2 comments

Comments

@multimeric
Copy link

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?

@bluss
Copy link
Member

bluss commented Jul 29, 2021

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.

@multimeric
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants