ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

Refine conversions between array types

Open jturner314 opened this issue 3 years ago • 2 comments

  • Move into_shared from DataOwned to Data, add an A: Clone bound, and drop the "without any copying" guarantee. (See the discussion in #1021.)

  • Implement From for more combinations of array types.

jturner314 avatar Jun 05 '21 20:06 jturner314

I'm not sure about going from DataOwned to Data. I guess there are many alternatives for how it could work. I was first thinking of - unsure if we can realize it - a conversion of owned arrays only, which would move if needed otherwise clone.

bluss avatar Jun 05 '21 20:06 bluss

Okay, yeah, leaving it on DataOwned would be fine. We'd still add an A: Clone bound, and drop the "without any copying" guarantee. OwnedRepr, OwnedArcRepr, and the Owned variant of CowRepr would implement this without copying, but the View variant of CowRepr would copy.

jturner314 avatar Jun 05 '21 21:06 jturner314