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-outputspan.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ extension OutputSpan where Element: ~Copyable {
116
116
117
117
##### Bulk initialization of an `OutputSpan`'s memory:
118
118
119
-
We include functions to perform bulk initialization of the memory represented by an `OutputSpan`. Initializing an `OutputSpan` from known-sized sources (such as `Collection` or `Span`) uses every element of the source. It is an error to do so when the available storage of the `OutputSpan` is too little to contain every element from the source. Initializing an `OutputSpan` from`Sequence` or`IteratorProtocol` will copy as many items as possible, either until the input is empty or the `OutputSpan`'s available storage is zero.
119
+
We include functions to perform bulk initialization of the memory represented by an `OutputSpan`. Initializing an `OutputSpan` from a `Sequence` or a fixed-size source must use every element of the source. Initializing an `OutputSpan` from `IteratorProtocol` will copy as many items as possible, either until the input is empty or the `OutputSpan`'s available storage is zero.
120
120
121
121
```swift
122
122
extensionOutputSpan {
@@ -134,18 +134,24 @@ extension OutputSpan {
134
134
) ->Bool
135
135
136
136
/// Initialize this span's suffix with every element of the source.
137
+
///
138
+
/// It is a precondition that the `OutputSpan` can contain every element of the source.
137
139
@lifetime(self:copyself)
138
140
publicmutatingfuncappend(
139
141
fromContentsOfsource: someSequence<Element>
140
142
)
141
143
142
144
/// Initialize this span's suffix with every element of the source.
145
+
///
146
+
/// It is a precondition that the `OutputSpan` can contain every element of the source.
143
147
@lifetime(self:copyself)
144
148
publicmutatingfuncappend(
145
149
fromContentsOfsource: Span<Element>
146
150
)
147
151
148
152
/// Initialize this span's suffix with every element of the source.
153
+
///
154
+
/// It is a precondition that the `OutputSpan` can contain every element of the source.
0 commit comments