Function std::collections::bitv::from_fnExperimental
[-]
[+]
[src]
pub fn from_fn(len: uint, f: |uint| -> bool) -> Bitv
Creates a Bitv of the specified length where the value at each
index is f(index).
Example
fn main() { use std::collections::bitv::from_fn; let bv = from_fn(5, |i| { i % 2 == 0 }); assert!(bv.eq_vec(&[true, false, true, false, true])); }use std::collections::bitv::from_fn; let bv = from_fn(5, |i| { i % 2 == 0 }); assert!(bv.eq_vec(&[true, false, true, false, true]));