rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.76k stars 12.76k forks source link

Tracking Issue for `const_array_each_ref` #133289

Open bjoernager opened 1 day ago

bjoernager commented 1 day ago

Feature gate: #![feature(const_array_each_ref)]

This is a tracking issue for supporting the each_ref and each_mut methods in [T; N] in constant expressions.

Public API

impl<T, const N: usize> [T; N] {
    pub const fn each_ref(&self) -> [&T; N];

    pub const fn each_mut(&mut self) -> [&mut T; N];
}

Unresolved Questions