GitXplorerGitXplorer
K

index_many

public
9 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
0e5523d2979389709c2218989514ec7effe74190

Bump version due to new experiments

KKimundi committed 3 years ago
Unverified
171f26612ee5e1c5d7e2422717870fe7979c00da

Some small changes

KKimundi committed 3 years ago
Unverified
6a79d48d1bd26da3acdd74939c36d818de1e2962

add the std_proposal with many Result variants

KKimundi committed 3 years ago
Unverified
bfc9a2bef44a25007398949ae0aa48597775e79f

Exclude misc files, and bump version

KKimundi committed 3 years ago
Unverified
bc9a4e4aed5c73d523f3ba75633a4653f4d7f0a2

add misc files

KKimundi committed 3 years ago
Unverified
3eb3e32ae309c6ab25c592ae76c151e41b561e6d

add additional codegen case

KKimundi committed 3 years ago

README

The README file for this repository.

Proof of concept functions for (mutably) accessing a slice at multiple positions at once via an array of indices.

Provided APIs

This crate implements multiple APIs:

  • "simple": accepts a sorted array [usize; N] of indices.
  • "simple_result": accepts a sorted array [usize; N] of indices, but with an Result based API.
  • "slice_index": accepts a sorted array [I; N] of indices, where I: SliceIndex<[T]>.
  • "generic": uses a generic I: Indices<N> that allows for more flexibility.

Example

use index_many::generic::index_many_mut;

let mut v = vec![1, 2, 3, 4, 5];
let [a, b, c] = index_many_mut(&mut v, [0, 2, 4]);
*a += 10;
*b += 100;
*c += 1000;
assert_eq!(v, vec![11, 2, 103, 4, 1005]);

Generated Assembly

The docs contain example functions with their x86_64 assembly codegen. See the [crate::_doc_assembly] module.