Proof of concept functions for (mutably) accessing a slice at multiple positions at once via an array of indices.
This crate implements multiple APIs:
[usize; N]
of indices.[usize; N]
of indices, but with an Result
based API.[I; N]
of indices, where I: SliceIndex<[T]>
.I: Indices<N>
that allows for more flexibility.```rust use indexmany::generic::indexmany_mut;
let mut v = vec![1, 2, 3, 4, 5]; let [a, b, c] = indexmanymut(&mut v, [0, 2, 4]); *a += 10; *b += 100; *c += 1000; assert_eq!(v, vec![11, 2, 103, 4, 1005]); ```
The docs contain example functions with their x86_64 assembly codegen. See the [crate::_doc_assembly
] module.