Trait optimath::ConstIndex[][src]

pub unsafe trait ConstIndex<T, const N: usize> {
    fn i(self, index: usize) -> T;
}
Expand description

implement this on types that can be indexed into that have a size known at compile time

mutability: just implement this twice, with &E &mut E as T

unsafety: calling .i(x) with x < N must successfully return T

unsafety: .i(x) and .i(y) return different objects when x != y. i.e. they do not alias.

Required methods

Implementors