Skip to content

Commit f0e3a99

Browse files
committed
[Doc] [SR-10094] Add missing documentation for SE-0237
https://bugs.swift.org/browse/SR-10094
1 parent c8e0d88 commit f0e3a99

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

stdlib/public/core/Sequence.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,16 @@ public protocol Sequence {
363363
initializing ptr: UnsafeMutableBufferPointer<Element>
364364
) -> (Iterator,UnsafeMutableBufferPointer<Element>.Index)
365365

366+
/// Call `body(p)`, where `p` is a pointer to the collection's
367+
/// contiguous storage. If no such storage exists, it is
368+
/// first created. If the collection does not support an internal
369+
/// representation in a form of contiguous storage, `body` is not
370+
/// called and `nil` is returned.
371+
///
372+
/// A `Collection` that provides its own implementation of this method
373+
/// must also guarantee that an equivalent buffer of its `SubSequence`
374+
/// can be generated by advancing the pointer by the distance to the
375+
/// slice's `startIndex`.
366376
func withContiguousStorageIfAvailable<R>(
367377
_ body: (UnsafeBufferPointer<Element>) throws -> R
368378
) rethrows -> R?

0 commit comments

Comments
 (0)