orx_v/impl_nvec/
range.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{Dim, IntoIdx, NVec, D1};
use core::ops::Range;

impl NVec<D1, usize> for Range<usize> {
    #[inline(always)]
    fn at(&self, idx: impl IntoIdx<D1>) -> usize {
        self.start + idx.into_idx()[0]
    }

    fn child(&self, _: <D1 as Dim>::ChildIdx) -> impl NVec<<D1 as Dim>::PrevDim, usize> {
        self
    }

    fn all(&self) -> impl Iterator<Item = usize> {
        self.start..self.end
    }
}