selection_iter

Function selection_iter 

Source
pub fn selection_iter<T>(v: &[T]) -> impl Iterator<Item = Vec<&T>>
Expand description

Iterates through every possible combination of selecting elements from the input. Returns references to the input.

let input = [1, 2];
let want = [vec![], vec![&input[1]], vec![&input[0]], vec![&input[0], &input[1]]];
assert_eq!(aoclib_rs::iter::selection_iter(&input).collect::<Vec<_>>(), want);