Skip to content

Commit 5585bc6

Browse files
committed
Move a section
1 parent bd7c340 commit 5585bc6

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

proposals/nnnn-outputspan.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
- [Proposed solution](#proposed-solution)
2727

28-
- [Detailed Design](#detailed-design)
28+
- [Detailed Design](#design)
2929

3030
- [Source compatibility](#source-compatibility)
3131

@@ -144,24 +144,6 @@ extension OutputSpan where Element: ~Copyable {
144144
}
145145
```
146146

147-
`OutputSpan` provides the ability to access its initialized elements by index:
148-
```swift
149-
extension OutputSpan wehre Element: ~Copyable {
150-
/// The type that represents an initialized position in an `OutputSpan`.
151-
typealias Index = Int
152-
153-
/// The range of initialized positions for this `OutputSpan`.
154-
var indices: Range<Index> { get }
155-
156-
/// Accesses the element at the specified initialized position.
157-
subscript(_ index: Index) -> Element { borrow; mutate }
158-
// accessor syntax from accessors roadmap (https://forums.swift.org/t/76707)
159-
160-
/// Exchange the elements at the two given offsets
161-
mutating func swapAt(_ i: Index, _ j: Index)
162-
}
163-
```
164-
165147

166148
##### Bulk initialization of an `OutputSpan`'s memory:
167149

@@ -289,6 +271,24 @@ extension OutputSpan where Element: ~Copyable {
289271
}
290272
```
291273

274+
`OutputSpan` also provides the ability to access its individual initialized elements by index:
275+
```swift
276+
extension OutputSpan wehre Element: ~Copyable {
277+
/// The type that represents an initialized position in an `OutputSpan`.
278+
typealias Index = Int
279+
280+
/// The range of initialized positions for this `OutputSpan`.
281+
var indices: Range<Index> { get }
282+
283+
/// Accesses the element at the specified initialized position.
284+
subscript(_ index: Index) -> Element { borrow; mutate }
285+
// accessor syntax from accessors roadmap (https://forums.swift.org/t/76707)
286+
287+
/// Exchange the elements at the two given offsets
288+
mutating func swapAt(_ i: Index, _ j: Index)
289+
}
290+
```
291+
292292

293293
##### Interoperability with unsafe code
294294

0 commit comments

Comments
 (0)