Skip to content

Unsafe[Mutable]BufferPointer should provide indices and/or forEach even when Element: ~Copyable #76509

Open
@grynspan

Description

@grynspan

Motivation

It's a pain in the patella to iterate over a buffer pointer containing non-copyable values. Seems like indices and/or a borrowing forEach(_:) ought to be possible to implement even for non-copyable values.

Proposed solution

Implement indices and forEach(_:) when Self doesn't conform to Sequence or Collection.

Alternatives considered

There's probably a dozen other ways to accomplish iteration here that would be concise and "Swifty".

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA feature request or implementationmove-onlyFeature → type declarations: Move-only type declarationsstandard libraryArea: Standard library umbrellatriage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions