Skip to content

Tracking Issue for BinaryHeap::contains and BinaryHeap::remove #82001

Closed
@billyrieger

Description

@billyrieger

Feature gate: #![feature(binary_heap_contains_remove)]

This is a tracking issue for BinaryHeap::contains and BinaryHeap::remove. These methods are missing from the BinaryHeap API and both are common operations that one would expect to have for any general-purpose container.

Previous discussion: #66724.

Public API

impl<T: Ord> BinaryHeap<T> {
    pub fn contains<Q: ?Sized>(&self, item: &Q) -> bool
    where
        T: Borrow<Q>,
        Q: PartialEq;

    pub fn remove<Q: ?Sized>(&self, item: &Q) -> Option<T>
    where
        T: Borrow<Q>,
        Q: PartialEq;
}

Steps / History

Unresolved Questions

  • What is the best way to check if an item exists in a BinaryHeap?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions