Alejandro Alonso
d44d6a3a26
Update UniqueArray+Append.swift
2026-08-12 15:04:38 -07:00
Alejandro Alonso
1b511f7652
Update UniqueArray+Append.swift
2026-08-12 14:07:15 -07:00
Alejandro Alonso
6c7ebb3cb9
Update UniqueArray+Append.swift
2026-08-12 13:32:38 -07:00
Alejandro Alonso
4fd692f00b
Apply review suggestions
2026-08-12 13:29:24 -07:00
Alejandro Alonso
f2914d4fb4
Eliminate some duplicate bounds checks for UniqueArray
2026-08-12 12:25:12 -07:00
Karoy Lorentey
669eb09cea
Use Iterable from the Standard Library, replacing the local definition
2026-07-27 13:32:46 -07:00
Karoy Lorentey
232dc7f9ee
Add second parameter to Container.makeBorrowingIterator(from:to:)
2026-07-21 15:21:45 -07:00
Karoy Lorentey
e75f053e46
Update MutableContainer
...
- Add `nextMutableSpan(after:)` and `nextMutableSpan(after:maxCount:limitedBy)`, replacing `nextMutableSpan(after:maxCount:)` as the core access primitives
- Add `previousMutableSpan` default algorithms on bidirectional mutable containers
2026-07-20 15:44:35 -07:00
Karoy Lorentey
95395ad9d2
Add BidirectionalContainer.spanBoundary(before:maxDistance:limitedBy:) and make it the core primitive
2026-07-20 11:51:43 -07:00
Karoy Lorentey
e70b4df228
Introduce Container.nextSpan(after:maxCount:limitedBy:) and make it the core Container primitive
2026-07-18 14:14:13 -07:00
Karoy Lorentey
a7f6b90c99
Make the limit optional in Container.nextSpan(after:limitedBy:). Review and update default implementations
...
- Make `nextSpan(after:limitedBy:)` the core iteration interface
- Review default algorithms and update them to use it, speeding them up
- Spin off `Span._nextSpan(after:maxCount)` and `Span._nextSpan(after:limitedBy:)` with copying lifetime semantics. This allows forwarding to these without having to override lifetimes.
2026-07-17 16:57:26 -07:00
Karoy Lorentey
99ac14d1fa
previousSpan(before:maxCount:) ⟹ spanBoundary(before:maxDistance:)
...
This allows MutableContainers to support mutating iteration backwards without requiring a separate MutableBidirectionalContainer protocol.
2026-07-17 11:50:38 -07:00
Karoy Lorentey
62332dc40a
Avoid borrow/mutate accessors before Swift 6.4
2026-07-07 16:52:32 -07:00
Karoy Lorentey
ff695132ed
Bump availability of Iterable_ and Container protocols to SwiftStdlib 6.4
...
This is preparing for switching over to the stdlib’s definition of `protocol Iterable`, assuming it will land with macOS 27/iOS 27 etc availability; `Container` is refining `Iterable`, so it needs matching availability.
If `Iterable` won’t ship in Swift 6.4, then we’ll need to bump this again.
2026-07-07 14:22:45 -07:00
Karoy Lorentey
a80c9d1257
Container: Add makeBorrowingIterator(from:) and currentIndex(of:) requirements
2026-07-07 14:21:54 -07:00
Karoy Lorentey
d0b4c4c215
IterableIterator_ → BorrowingIterator_
2026-07-07 14:21:53 -07:00
Karoy Lorentey
bb0dc189ef
maximumCount → maxCount
...
While we’re here, adjust `RigidSet.insert(maximumCount:initializingWith:)` and similar APIs to be consistent with RangeReplaceableContainer’s methods.
2026-07-07 14:21:53 -07:00
Karoy Lorentey
3ba8d70ec3
Review and update container protocols and conformances
...
- @inlinable → @_alwaysEmitIntoClient for now, to avoid temporary ABI issues
- Review RangeReplaceableContainer algorithms; add missing ones:
- New requirements: `removeFirst()`, `removeFirst(_:)`, `_customRemoveLast()`, `_customRemoveLast(_:) (with default implementations)
- `func removeAll()`
- `func removeLast()`, `func removeLast(_:)`, `func popLast()` when self is also bidirectional
- Review RigidArray, UniqueArray algorithms; remove ones needlessly duplicating functionality already provided by RRC. Try not to break source compatibility.
2026-07-07 14:18:09 -07:00
Karoy Lorentey
e8b09ade25
Add subscript requirements to [Mutable]Container with borrow/mutate accessors
2026-06-22 20:10:22 -07:00
Karoy Lorentey
73ec3d3416
[BasicContainers, DequeModule] Clean up Equatable/Hashable conformances
...
Make sure all types conditionally conform to Equatable/Hashable, even if their contents happen to be noncopyable.
2026-06-18 12:56:23 -07:00
Karoy Lorentey
3d68fc1107
Clean up the UniqueBox/Ref/MutableRef situation
...
- UniqueBox is public API, so we cannot remove it in favor of the stdlib’s
- Remove Ref and MutableRef. Keep an internal _MutableRef to work around stdlib limitations.
2026-06-17 18:29:41 -07:00
Karoy Lorentey
bced34defa
Review error handling
2026-06-17 18:24:03 -07:00
Karoy Lorentey
85cdb77d25
Fix build issues
2026-06-17 16:17:36 -07:00
Nate Cook
dca015d7e8
Align Iterable with proposal
...
Adds throwing and ~Escapable elements
2026-06-17 14:27:29 -07:00
Nate Cook
4bda43f4a9
Renaming BorrowingSequence_ to Iterable_
2026-06-17 14:27:29 -07:00
Karoy Lorentey
28e9d98a7e
Fix deprecation warnings
2026-06-17 13:48:54 -07:00
Alejandro Alonso
06423d7329
Fix broken docs
2026-06-17 13:48:54 -07:00
Alejandro Alonso and Karoy Lorentey
2a39308613
Update Sources/BasicContainers/UniqueArray/UniqueArray.swift
...
Co-authored-by: Karoy Lorentey <klorentey@apple.com >
2026-06-17 13:48:54 -07:00
Alejandro Alonso
6da58357a3
Rename reallocate to setCapacity for Rigid and UniqueArray
...
Update UniqueArray.swift
Update UniqueArray.swift
2026-06-17 13:48:53 -07:00
Karoy Lorentey
c38e47d03e
[BasicContainers, DequeModule] Avoid using deprecated API
2026-05-07 16:17:20 -07:00
Karoy Lorentey
a6fd64697a
[ContainersPreview] Borrow ⟹ Ref
...
Also update the type’s public API surface to reflect SE-0519, leaving deprecated aliases for the old names.
2026-05-06 18:00:13 -07:00
Franz Busch
3c373b900c
Use the defines from traits directly
...
Package traits already pass defines with their trait name when building. Instead of adding our own conditional defines based on the traits we can use the trait provided defines directly. I observed that various tooling behaves better with the trait provided defines.
2026-05-06 07:41:02 -07:00
Karoy Lorentey
bb7839ae50
Merge pull request #642 from lorentey/doc-fix
...
[BasicContainers] Fix copypasta in `UniqueArray.edit`’s docs
2026-05-05 17:31:51 -07:00
Karoy Lorentey
50f93dd05f
[BasicContainers] Fix copypasta in UniqueArray.edit’s docs
2026-05-05 16:18:11 -07:00
Karoy Lorentey
022795168a
[BasicContainers] Enable APIs scheduled to ship in 1.5.0
...
- `RigidArray.nextMutableSpan(after:maximumCount:)`
- `UniqueArray.nextMutableSpan(after:maximumCount:)`
- `RigidDeque.nextMutableSpan(after:maximumCount:)`
- `UniqueDeque.nextMutableSpan(after:maximumCount:)`
- `UniqueArray.init(minimumCapacity:)` (replacing `.init(capacity:)`)
- `UniqueDeque.init(minimumCapacity:)` (replacing `.init(capacity:)`)
- `RigidDeque.index(before:)`
- `UniqueDeque.index(before:)`
- `RigidDeque.formIndex(before:)`
- `UniqueDeque.formIndex(before:)`
2026-05-05 16:01:31 -07:00
Karoy Lorentey
5bd8ab095d
[BasicContainers] UniqueArray.replace(removing:copying): Fix overallocation issue
...
`UniqueArray.replace(removing:copying:)` overloads overestimated the amount of memory they need, sometimes leading to unnecessary reallocations. Fix this.
2026-04-22 16:23:15 -07:00
Karoy Lorentey
bf8441dc95
[BasicContainers] Fix typos in doc comments
2026-04-08 18:31:11 -07:00
Karoy Lorentey
a9b64d4f09
[BasicContainers] RigidArray,UniqueArray: Add Equatable conformance on Swift 6.4
...
This is currently conditional on the UnstableContainersPreview trait. (Swift 6.4 has not shipped yet, so we cannot unconditionally enable this without risking breakage.)
2026-04-08 18:31:11 -07:00
Karoy Lorentey
7f4cebd2c5
BasicContainers] Add UniqueArray.isTriviallyIdentical(to:)
2026-04-08 18:31:10 -07:00
Karoy Lorentey
597b7a7dd2
Revert most of the availability constraints from 419e2f and 4c0482 🎉
2026-03-27 11:25:43 -07:00
Nate Cook
a99a015934
Disambiguate ContainersPreview and stdlib
...
Adds trailing underscores to the BorrowingSequence protocols and
requirements, in order to allow both parallel conformances and
the ability to evolve the requirements in this package.
2026-03-27 07:41:32 -05:00
Karoy Lorentey
d2d3b917ca
[BasicContainers, ContainersPreview, DequeModule] More SuppressedAssociatedTypesWithDefaults fixups
2026-03-26 18:12:41 -07:00
Karoy Lorentey
419e2f7df2
[ContainersPreview] Exhibit A in the case against prototyping things in the stdlib 😞
2026-03-26 17:14:45 -07:00
Karoy Lorentey
70a25f1f69
[ContainersPreview] Bump required toolchain to 6.4 for new protocols
2026-03-26 14:51:08 -07:00
Karoy Lorentey
a8389f300a
[BasicContainers, DequeModule] Avoid defining new API in a point release
...
Stash them behind the UnstableContainersPreview package trait for now (making them non-public API).
2026-03-17 16:33:20 -07:00
Karoy Lorentey
8f88cce7c7
[BasicContainers, ContainersPreview] Make sure package traits “work” on 6.2 toolchains
...
“Work” in this case means that they can be enabled without breaking the build — not necessarily that all features are available.
Swift 6.2 is highly prone to runtime crashes in `swift_getTypeByMangledName` in generic code that uses ownership features. Swift 6.3 will resolve that.
2026-03-17 15:38:34 -07:00
Karoy Lorentey
6bbed0e1e2
[ContainersPreview] Conform [Unique,Rigid]Array and [Unique,Rigid]Deque to container protocols
2026-03-17 13:13:42 -07:00
Karoy Lorentey
1c69635852
Add SPDX-License-Identifier tags
2026-03-05 19:39:24 -08:00
Karoy Lorentey
d9b09ecde8
Update copyright dates
2026-03-05 19:39:20 -08:00
Karoy Lorentey
214d75cb73
BorrowingSequence: estimatedCount ⟹ underestimatedCount
...
EstimatedCount is largely pointless. Knowing the exact count does enable a fast negative path for `elementsEqual`, but we can otherwise make do with just the (much simpler to understand/deal with) `underestimatedCount` that already exists on `Sequence`.
2026-03-05 15:33:27 -08:00