Karoy Lorentey
f83e9b6538
Rename Collection.underestimatedCount_
2026-03-27 11:47:00 -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
4c04822689
[ContainersPreview] Exhibit B in the case against prototyping things in the stdlib 😳
2026-03-26 18:13:22 -07: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
Nate Cook
a2cf230400
Align BorrowingSequence etc with proposal
...
This updates the ContainersPreview module to use the same
API as the proposed BorrowingSequence protocol and its supporting
types. In particular, instead of using Span as the iterator for
itself and other contiguously-stored types, this introduces
SpanIterator.
2026-03-26 14:25:01 -05: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
94e8cabe4b
[BasicContainers] RigidArray: Correct spelling of replacement for deprecated method
2026-03-06 16:10:48 -08: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
Nate Cook
54ca53612f
Include notes about index mutation in span(after/before:)
...
The indexes passed to span(after:) and friends on UniqueArray
and RigidArray are modified before return. This adds notes
about the updated values to the method documentation, along
with a few other minor formatting changes (dropping smart
quotes, single-sentence abstracts).
2026-03-02 16:38:48 -08:00
Karoy Lorentey
d0825fe2e0
[BasicContainers] RigidArray, UniqueArray: Add Drain-based consumption
2026-02-27 18:00:47 -08:00
Karoy Lorentey
bc7b0ff73d
[BasicContainers] Add Producer-based array operations
2026-02-27 17:58:21 -08:00
Karoy Lorentey
3e505b97bb
Merge pull request #575 from lorentey/validate-maximumCount
...
[RigidArray, RigidDeque].nextSpan: Validate `maximumCount`
2026-02-16 17:21:24 -08:00
Karoy Lorentey
934ad786d2
Merge pull request #570 from lorentey/remove-outputspan-workaround
...
Remove workaround for bug in OutputSpan.wUMBP
2026-02-16 17:14:44 -08:00
Karoy Lorentey
621374557c
Array, Deque types: Introduce _checkItemIndex, _checkValidIndex, _checkValidBounds
2026-02-16 17:05:36 -08:00
Karoy Lorentey
ac7a8bf61b
[RigidArray, RigidDeque].nextSpan: Validate maximumCount
...
`nextSpan(after:,maximumCount:)` failed to validate that `maximumCount > 0`, potentially allowing out-of-bounds access.
2026-02-16 15:54:49 -08:00
Karoy Lorentey
5a4ee8be66
Update docs for Container.nextSpan(after:maximumCount:)
...
Oops, the docs did not explain `maximumCount`.
2026-02-16 15:49:33 -08:00
Alejandro Alonso
3bf8de6e2b
Add new span taking copying initializers to Rigid and UniqueArray
2026-02-12 11:01:30 -08:00
Karoy Lorentey
8ef702c8a5
Remove workaround for OutputSpan.wUMBP bug
2026-02-05 17:07:03 -08:00
Karoy Lorentey
35e09984f5
[doc] Add missing colon after “Parameters”
2026-02-05 16:48:05 -08:00
Karoy Lorentey
b9fd3ed56e
RigidArray, UniqueArray: Move remaining deprecations to dedicated file
2026-02-05 16:46:14 -08:00
Karoy Lorentey
653a60b8e7
replaceSubrange(_:...) → replace(removing:...)
2026-02-05 14:56:51 -08:00
Karoy Lorentey
e4a874b67a
Rigid & Unique types: Add Equatable, Hashable, Custom[Debug]StringConvertible operations
...
Currently these are all conditional on copyable elements, and the types cannot conform to the actual protocols yet.
2026-02-04 23:24:08 -08:00
Karoy Lorentey
7692d9c4b3
RigidArray: Add test coverage; revive some container-based operations
2026-02-04 22:41:33 -08:00
Karoy Lorentey
84e9932478
Rigid/Unique types: Review consumption methods and unify their shapes
...
Drain-returning variants will need to be added on RigidArray/UniqueArray later.
2026-02-04 17:32:41 -08:00
Karoy Lorentey
06f2ec073d
Rigid, Unique types: Rework OutputSpan-based append/prepend/insert/replaceSubrange primitives
2026-02-04 17:29:43 -08:00
Karoy Lorentey
9503f8fe57
Improve consistency of precondition failure messages
...
More uniform message strings should feel better, and they should ever so slightly reduce code size.
2026-02-04 10:27:17 -08:00
Karoy Lorentey
b768d22393
[BasicContainers] RigidArray, UniqueArray: “precisely once” → “at most once”
...
Loosen guarantees about how many times closure arguments are getting called, so that e.g. insertions of zero items do not necessarily need to call their callback with an empty OutputSpan.
(For these array types we can reinstate the guarantee later, if it turns out to be important/useful. However, the generalized primitives will need to allow their callbacks to get called an arbitrary number of times, and it seems useful to establish that (at least partially) with these simple array types too.)
2026-02-04 10:09:00 -08:00
Karoy Lorentey
99da8a72e0
[BasicContainers] RigidArray, UniqueArray: Add formIndex(before:)
2026-02-03 15:10:11 -08:00
Karoy Lorentey
030f751515
[BasicContainers] RigidArray, UniqueArray: Fill out missing indexing APIs
2026-02-03 14:06:03 -08:00
Karoy Lorentey
1e310e2908
[BasicContainers] RigidArray, UniqueArray: Rename copy() → clone()
2026-02-03 13:20:48 -08:00
Karoy Lorentey
3d4423f33e
[BasicContainers] RigidArray, UniqueArray: Gather all public initializers into the same source file
2026-02-03 13:20:09 -08:00
Karoy Lorentey
0c376aceb6
[BasicContainers] Move array implementations into subdirectories
...
(This sets the stage for more data structures in BasicContainers)
2026-02-03 13:05:03 -08:00