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
Feature gate:
#![feature(const_binary_search)]This is a tracking issue for constifying the family of binary search functions on slice.
Public API
Steps / History
const_binary_search#159528Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩