union_map_dyn

Macro union_map_dyn 

Source
macro_rules! union_map_dyn {
    ($($val:expr),*) => { ... };
}
Expand description

Unions zero or more SortedDisjointMap iterators, creating a new SortedDisjointMap iterator. The input iterators need not be of the same type.

For input iterators of the same type, union may be slightly faster.

§Performance

All work is done on demand, in one pass through the input iterators. Minimal memory is used.

§Examples

use range_set_blaze::prelude::*;

let a = RangeMapBlaze::from_iter([(2..=2, "a"), (6..=200, "a")]);
let b = CheckSortedDisjointMap::new([(2..=6, &"b")]);
let c = RangeMapBlaze::from_iter([(1..=2, "c"), (5..=100, "c")]);
let union = union_map_dyn!(a.range_values(), b, c.range_values());
assert_eq!(union.into_string(), r#"(1..=2, "c"), (3..=4, "b"), (5..=100, "c"), (101..=200, "a")"#);