Function to get index from SoA slice

This commit is contained in:
Ayaz Hafiz 2023-04-10 15:43:30 -05:00
parent f0b017b807
commit c8de1e5a27
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -137,6 +137,10 @@ impl<T> Slice<T> {
pub fn into_iter(&self) -> impl Iterator<Item = Index<T>> {
self.indices().map(|i| Index::new(i as _))
}
pub const fn at(&self, i: usize) -> Index<T> {
Index::new(self.start + i as u32)
}
}
#[derive(PartialEq, Eq)]