Skip to content

Tracking Issue for const_binary_search #159532

Description

@Lars-Schumann

Feature gate: #![feature(const_binary_search)]

This is a tracking issue for constifying the family of binary search functions on slice.

Public API

// core::slice

impl<T> [T] {
    pub const fn binary_search(&self, x: &T) -> Result<usize, usize>
    where
        T: [const] Ord,

    pub const fn binary_search_by<'a, F>(&'a self, mut f: F) -> Result<usize, usize>
    where
        F: [const] FnMut(&'a T) -> Ordering + [const] Destruct,

    pub const fn binary_search_by_key<'a, B, F>(&'a self, b: &B, mut f: F) -> Result<usize, usize>
    where
        F: [const] FnMut(&'a T) -> B + [const] Destruct,
        B: [const] Ord + [const] Destruct,

    pub const fn partition_point<P>(&self, mut pred: P) -> usize
    where
        P: [const] FnMut(&T) -> bool + [const] Destruct,
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions