Skip to content

Set and Dictionary should have remove(where:). #78364

Open
@dabrahams

Description

@dabrahams

Motivation

It's not possible to implement this operation efficiently from outside the library. You either iterate a snapshot and end up silently copying the collection, or you have to collect the items to be removed in a separate collection and then .subtract that.

Proposed solution

Add remove(where:) to Set and Dictionary.

Alternatives considered

No response

Additional information

No response

Metadata

Metadata

Assignees

Labels

DictionaryArea → standard library: the `Dictionary` typefeatureA feature request or implementationstandard libraryArea: Standard library umbrellaswift evolution proposal neededFlag → feature: A feature that warrants a Swift evolution proposal

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions