You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why is there no IntoIterator implementation for ArrayBase itself? I want to collect all elements into another data structure (or just map its type, but that's not available either), but all I can access are references of the elements, which is kind of bad. I could use mem::replace, but that requires me to create dummy values, which is bad for performance. So I'd like to just consume the whole thing and collect it into a new data structure instead.
The text was updated successfully, but these errors were encountered:
ok, so the question is about a consuming by-value iterator on OwnedArray. What's your element type? Depending on it, it may not be so expensive.
The general question of a consuming iterator for OwnedArray is not so simple when you factor in other memory layouts apart from the regular ones, but those complications only affect the complexity of the implementation, and should not impact the performance of the eventual solution.. I hope.
Array::into_raw_vec now exists, but it has the major caveats about using the internal memory order. It would not be a good by value IntoIterator since its element order does not always match .iter().
Uh oh!
There was an error while loading. Please reload this page.
Why is there no IntoIterator implementation for ArrayBase itself? I want to collect all elements into another data structure (or just map its type, but that's not available either), but all I can access are references of the elements, which is kind of bad. I could use mem::replace, but that requires me to create dummy values, which is bad for performance. So I'd like to just consume the whole thing and collect it into a new data structure instead.
The text was updated successfully, but these errors were encountered: