mirror of
https://github.com/apple/swift-algorithms
synced 2026-11-26 04:27:48 +00:00
Curate documentation for Algorithms module (#201)
This commit is contained in:
1 parent
bfcaaa8758
commit
fc8fdfd4dc
17 files changed
+377
-5
No files matched your search
@@ -94,6 +94,10 @@ extension Collection {
|
||||
/// Returns a collection of pairs *(i, x)*, where *i* represents an index of
|
||||
/// the collection, and *x* represents an element.
|
||||
///
|
||||
/// The `indexed()` method is similar to the standard library's `enumerated()`
|
||||
/// method, but provides the index with each element instead of a zero-based
|
||||
/// counter.
|
||||
///
|
||||
/// This example iterates over the indices and elements of a set, building an
|
||||
/// array consisting of indices of names with five or fewer letters.
|
||||
///
|
||||
@@ -105,7 +109,7 @@ extension Collection {
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// Returns: A collection of paired indices and elements of this collection.
|
||||
/// - Returns: A collection of paired indices and elements of this collection.
|
||||
@inlinable
|
||||
public func indexed() -> IndexedCollection<Self> {
|
||||
IndexedCollection(base: self)
|
||||
|
||||
Reference in new issue
Block a user