# \[API Review\] PriorityQueue APIs

**URL:** <https://forums.swift.org/t/api-review-priorityqueue-apis/49932>\
**Category:** Collections\
**Created:** [June 25, 2021, 8:12pm UTC](https://forums.swift.org/t/api-review-priorityqueue-apis/49932 "2021-06-25T20:12:24Z")\
**Posts on this page:** 1\
**Showing post:** 25

<div class="post-metadata">

**Author:** ![kylemacomber](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kylemacomber/32/12298_2.png) [@kylemacomber](https://forums.swift.org/u/kylemacomber)\
**Post date:** [June 27, 2021, 3:22am UTC](https://forums.swift.org/t/api-review-priorityqueue-apis/49932/25 "2021-06-27T03:22:43Z")

</div>

A concern I have with adding a closure/`KeyPath` comparator is that `PriorityQueue` is not the only data structure that would benefit from this kind of feature. I think `Set`, `OrderedSet`, and (soon!) `SortedSet` would similarly benefit from being able to compare/hash on a projection of their element. It seems undesirable to have an alternate variant of all of these data structures.

---

_[View the full topic](https://forums.swift.org/t/api-review-priorityqueue-apis/49932)._
