TIL `partition` function of `Collection`; TIL `__consumable` in Swift
Writing answer to comment on this PR looked for where first
of Array
is declared in Swift. Found partition
function. I should use it!
var numbers = [30, 40, 20, 30, 30, 60, 10]
let p = numbers.partition(by: { $0 > 30 })
// p == 5
// numbers == [30, 10, 20, 30, 30, 60, 40]
Further exploring Swift library sources came across __consumable
and jumped to Preparing the iteration ABI for move-only types and to Ownership Manifesto.
Accidentally came across this Cityscapes dataset. Worth keeping a bookmark. Hope to use it later for my own purpose.