Unsafe[Mutable]BufferPointer
should provide indices
and/or forEach
even when Element: ~Copyable
#76509
Labels
feature
A feature request or implementation
move-only
Feature → type declarations: Move-only type declarations
standard library
Area: Standard library umbrella
triage needed
This issue needs more specific labels
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
The text was updated successfully, but these errors were encountered: