https://github.com/lilyball/swift-deque
A double-ended queue collection for Swift
https://github.com/lilyball/swift-deque
collections data-types framework swift swift-package-manager
Last synced: 11 months ago
JSON representation
A double-ended queue collection for Swift
- Host: GitHub
- URL: https://github.com/lilyball/swift-deque
- Owner: lilyball
- License: apache-2.0
- Created: 2020-11-23T21:53:08.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-25T23:06:47.000Z (about 5 years ago)
- Last Synced: 2025-02-27T04:26:00.257Z (12 months ago)
- Topics: collections, data-types, framework, swift, swift-package-manager
- Language: Swift
- Homepage:
- Size: 39.1 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Deque
This package provides `Deque`, a random-access collection similar to `Array` but backed by a growable ring buffer and offering efficient insertion and removal at the front and back.
See `Guide.playground` for more information on usage.
## Adding Deque as a dependency
To use `Deque` in a SwiftPM project, add the following line to the dependencies in your `Package.swift` file:
```swift
.package(url: "https://github.com/lilyball/swift-deque", from: "0.0.2"),
```
Because `Deque` is still pre-1.0, source-stability is only guaranteed within minor versions. If you don't want potentially source-breaking package updates, use this dependency specification instead:
```swift
.package(url: "https://github.com/lilyball/swift-deque", .upToNextMinor(from: "0.0.2")),
```
Finally, include `"Deque"` as a dependency for your target:
```swift
let package = Package(
// name, etc…
dependencies: [
.package(url: "https://github.com/lilyball/swift-deque", .upToNextMinor(from: "0.0.2")),
],
targets: [
.target(name: "", dependencies: [
.product(name: "Deque", package: "swift-deque")
]),
// other targets…
]
)
```