mirror of
https://github.com/apple/swift-collections
synced 2026-11-25 04:37:48 +00:00
Also freeze Heap types
This commit is contained in:
1 parent
0e9e7f13e4
commit
837a273bef
2 files changed
+3
No files matched your search
@@ -12,6 +12,7 @@
|
||||
extension Heap {
|
||||
/// A view of a `Heap`'s elements, as a `Sequence` from the smallest to
|
||||
/// largest element.
|
||||
@frozen
|
||||
public struct AscendingView: Sequence, IteratorProtocol {
|
||||
@usableFromInline
|
||||
internal var _base: Heap
|
||||
@@ -30,6 +31,7 @@ extension Heap {
|
||||
|
||||
/// A view of a `Heap`'s elements, as a `Sequence` from the largest to
|
||||
/// smallest element.
|
||||
@frozen
|
||||
public struct DescendingView: Sequence, IteratorProtocol {
|
||||
@usableFromInline
|
||||
internal var _base: Heap
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
/// "Min-Max Heaps and Generalized Priority Queues."
|
||||
/// *Communications of the ACM*, vol. 29, no. 10, Oct. 1986., pp. 996-1000,
|
||||
/// doi:[10.1145/6617.6621](https://doi.org/10.1145/6617.6621)
|
||||
@frozen
|
||||
public struct Heap<Element: Comparable> {
|
||||
@usableFromInline
|
||||
internal var _storage: ContiguousArray<Element>
|
||||
|
||||
Reference in new issue
Block a user