-
Notifications
You must be signed in to change notification settings - Fork 314
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
AsRef<[A]>
instead of Vec<A>
#1474
Comments
I believe that the reason for this limitation is that |
do you mean calling also, i am not specifically looking for something that would fit my purposes, im just trying to get an understanding for why a more flexible approach wasn't taken generics as input in functions are a great idea in api design in general, allowing for more flexible use, and not requiring the user to construct a specific data structure when all that is needed is a specific behaviour of that data structure: for example, using a in this case, i tried to go through the code and i dont really understand why a for example, if all that is needed is something that can iterate, the function can accept a |
Ya sorry, I should've been more specific, I was suggesting you call Happy to elaborate a bit: the goal for this function is to go from some kind of owned storage without copy to a new ndarray. The relevant call sites are as follows
I just don't think there's any trait that tells us all of this information1. I suppose there are other corner cases where Rust has created heap-allocated contiguous memory - a (Another piece of historical information: Footnotes
|
this is very interesting, i thought all types that implement ill look more into this as soon as i can, i suppose youre right tho, this might be the right tradeoff |
Static arrays ( A slightly more general version of |
ArrayBase::from_shape_vec()
is very much not ergonomic. would it be possible to have a function that takes a genericAsRef<[A]>
instead? being able to pass in aBox
ed array or an array owned by anRc
would be much better for both performance and ease of use. also,Vec
would still work the same way.The text was updated successfully, but these errors were encountered: