This package has been obsoleted by the Deque type in the Swift Collections package. Using this older package in not recommended in new Swift code; I expect the double-ended queue implementation in Swift Collections to perform better and to provide a richer interface. It is also being actively maintained/updated by the Swift Standard Library team.
Deque<Element> implements a double-ended queue type.
It’s an Array-like random-access collection of arbitrary elements that provides efficient O(1) insertion and deletion at both ends.
Deques are structs and implement the same copy-on-write value semantics as standard collection types like
Array and Dictionary.
Compatibility
Deque on the master branch is compatible with Swift 4.2.
Installation
CocoaPods
If you use CocoaPods, you can start using Deque by including it as a dependency in your Podfile:
pod 'Deque', '~> 3.1'
Carthage
For Carthage, add the following line to your Cartfile:
github "attaswift/Deque" ~> 3.1
Swift Package Manager
For Swift Package Manager, add SipHash to the dependencies list inside your Package.swift file:
A Double-Ended Queue Type in Swift
Deque
type in the Swift Collections package. Using this older package in not recommended in new Swift code; I expect the double-ended queue implementation in Swift Collections to perform better and to provide a richer interface. It is also being actively maintained/updated by the Swift Standard Library team.Deque<Element>
implements a double-ended queue type. It’s anArray
-like random-access collection of arbitrary elements that provides efficient O(1) insertion and deletion at both ends.Deques are structs and implement the same copy-on-write value semantics as standard collection types like
Array
andDictionary
.Compatibility
Deque
on themaster
branch is compatible with Swift 4.2.Installation
CocoaPods
If you use CocoaPods, you can start using
Deque
by including it as a dependency in yourPodfile
:Carthage
For Carthage, add the following line to your
Cartfile
:Swift Package Manager
For Swift Package Manager, add
SipHash
to the dependencies list inside yourPackage.swift
file: