Open grynspan opened 2 months ago
This is really a sub-task of "design protocols and language integration that support containers of ~Copyable", which @lorentey has been working on. I don't think we need a separate issue tracking it, but I'll let Karoy figure that out.
That's fair. I'm focused right now on the ergonomics of what we do have: is there something smaller we can do to improve them before we get anything resembling full collection type support?
Motivation
It's a pain in the patella to iterate over a buffer pointer containing non-copyable values. Seems like
indices
and/or a borrowingforEach(_:)
ought to be possible to implement even for non-copyable values.Proposed solution
Implement
indices
andforEach(_:)
whenSelf
doesn't conform toSequence
orCollection
.Alternatives considered
There's probably a dozen other ways to accomplish iteration here that would be concise and "Swifty".
Additional information
No response