Skip to content

[SE-0333] Mark as implemented #1541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions proposals/0333-with-memory-rebound.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@
* Proposal: [SE-0333](0333-with-memory-rebound.md)
* Authors: [Guillaume Lessard](https://github.com/glessard), [Andrew Trick](https://github.com/atrick)
* Review Manager: [Ben Cohen](https://github.com/airspeedswift)
* Status: **Awaiting implementation**
* Status: **Implemented (Swift 5.7)**
* Decision Notes: [Acceptance](https://forums.swift.org/t/54699)
* Implementation: [draft pull request][draft-pr]
* Implementation: [apple/swift#39529](https://github.com/apple/swift/pull/39529)
* Bugs: [SR-11082](https://bugs.swift.org/browse/SR-11082), [SR-11087](https://bugs.swift.org/browse/SR-11087)

[draft-pr]: https://github.com/apple/swift/pull/39529
[pitch-thread]: https://forums.swift.org/t/pitch-expand-usability-of-withmemoryrebound/52500

## Introduction

The function `withMemoryRebound(to:capacity:_ body:)`
executes a closure while temporarily binding a range of memory to a different type than the callee is bound to.
We propose to lift some notable limitations of `withMemoryRebound` and enable rebinding to a larger set of types,
as well as rebinding the memory pointed to by raw memory pointers and buffers.

Swift-evolution threads: [Pitch thread][pitch-thread], [Review thread](https://forums.swift.org/t/53799)
Swift-evolution threads: [Pitch thread](https://forums.swift.org/t/52500), [Review thread](https://forums.swift.org/t/53799)

## Motivation

Expand Down Expand Up @@ -263,8 +260,6 @@ extension UnsafeMutableRawBufferPointer {

## Detailed design

Note: please see the [draft PR][draft-pr] to visualize the proposed changes rather than the proposed final state.

```swift
extension UnsafePointer {
/// Executes the given closure while temporarily binding memory to
Expand Down