You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: proposals/nnnn-MutableSpan.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Mutability requires exclusive access, per Swift's [law of exclusivity][SE-0176].
37
37
38
38
#### MutableSpan
39
39
40
-
`MutableSpan` allows delegating mutations of a type's contiguous internal representation, by providing access to an exclusively-borrowed view of a range of contiguous, initialized memory. `MutableSpan`'s memory safety' relies on guarantees that:
40
+
`MutableSpan` allows delegating mutations of a type's contiguous internal representation, by providing access to an exclusively-borrowed view of a range of contiguous, initialized memory. `MutableSpan`'s memory safety relies on guarantees that:
41
41
- it has exclusive access to the range of memory it represents, providing data race safety and enforced by `~Copyable`.
42
42
- the memory it represents will remain valid for the duration of the access, providing lifetime safety and enforced by `~Escapable`.
43
43
- each access is guarded by bounds checking, providing bounds safety.
This function returns an instance of `MutableSpan` that represents a mutation of the same memory as represented by the callee. The callee can therefore no longer be mutated while the returned value exists:
93
+
This function returns an instance of `MutableSpan` that represents a mutation of the same memory as represented by the callee. The callee can therefore no longer be accessed (read or mutated) while the returned value exists:
94
94
95
95
```swift
96
96
var array = [1, 2, 3, 4, 5]
@@ -713,7 +713,7 @@ The `mutating` functions in this proposal generally do not represent mutations o
713
713
714
714
#### Harmonizing `extracting()` functions across types
715
715
716
-
The range of `extracting()` functions proposed here expands upon the range accepted in [SE-0437][SE-0437]. If the prefix and suffix variants are accepted, we should add them to `UnsafeBufferPointer`types as well. `Span` and `RawSpan`should also have `extracting()` functions with appropriate lifetime dependencies.
716
+
The range of `extracting()` functions proposed here expands upon the range accepted in [SE-0437][SE-0437]. If the prefix and suffix variants are accepted, we should add them to `UnsafeBufferPointer`types as well. `Span` and `RawSpan`should also have `extracting()` functions with appropriate lifetime dependencies.
717
717
718
718
#### <aname="OutputSpan"></a>Delegated initialization with `OutputSpan<T>`
0 commit comments