13 Commits
Author SHA1 Message Date
Karoy Lorentey b2424210b4 Container: Reinstate requirement for Comparable indices
I have a linked list prototype that can support comparable indices (and an O(1) `count`); accordingly, reinstate the requirement for index comparability. This eliminates a potential performance footgun for custom containers that define their own Index, as an incomparable index would make `func distance` 2x slower.
2026-09-21 10:41:46 -07:00
Karoy Lorentey 58e13a0525 Stop requiring BidirectionalContainer to provide comparable indices
This allows doubly linked lists to conform to the protocol.
2026-07-22 19:07:13 -07:00
Karoy Lorentey ea64e6332f Update RandomAccessContainer
- Require Index to be Comparable
- Add `formIndex(_:offsetBy:limitedBy:)` algorithm
2026-07-20 15:45: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 b2c1669aa7 [ContainersPreview] RandomAccessContainer: Add a separate set of default implementations for Index == Int
This avoids going through Strideable, likely assisting the inliner.

Also mark default implementations @_aeic, to avoid ABI headaches
2026-06-23 17:07:25 -07:00
Karoy Lorentey 250af87308 [ContainersPreview] Redeclare Container requirements in refining protocols
Use `override`/`@_nonoverride` to help associated type inference and to allow diverging implementations of select requirements in BidirectionalContainer, RandomAccessContainer, and MutableContainer.
2026-06-23 16:55:53 -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 597b7a7dd2 Revert most of the availability constraints from 419e2f and 4c0482 🎉 2026-03-27 11:25:43 -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 eb708a9ba5 [ContainersPreview] Audit some protocol extensions for SuppressedAssociatedTypesWithDefaults 2026-03-26 16:05:07 -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 6bbed0e1e2 [ContainersPreview] Conform [Unique,Rigid]Array and [Unique,Rigid]Deque to container protocols 2026-03-17 13:13:42 -07:00
Karoy Lorentey c4760ec21a [ContainersPreview] Flesh out container protocols a little more; add algorithms
(This is all untested, unproven code)
2026-03-13 10:30:49 -07:00